Posted on Updated on - Arjun

AngularJS and Codeigniter : Retrieve data from the database

Here I would will like to show you how to use Angular JS in CodeIgniter and I will show you how to get data from the database in Codigniter using Angular JS.

view : angularjs_view.php

Controller: Angularjs.php

Model : User_model.php

That’s it.

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

Arjun
I am Arjun from Hyderabad (India). I have been working as a software engineer from last 7+ years, and its my passion to learn new things and implement them as a practice. Aside from work, I likes gardening and spending time with pets.
  • Guest

    Easy to implement, I got a question though: What if I have several controllers – Angular controllers – and they are all at the app.js, how can I make the call to my codeigniter controllers? Thanks!

  • Easy to implement, I got a question though: What if I have several controllers – Angular controllers – and they are all at the app.js, how can I make the call to my codeigniter controllers? Can I just use the $http.get() from the app.js? Thanks in advance.

  • thnx its really help me to fetching data from mysql through php. thumbs Up from my http://www.mirchu.net/ team

  • freddy

    Hi arjun if you free please complete Update and Delete, Thanks

    • Sure .. Thank you.

  • Raghav Garg

    Hi Arjun, I am new to both codeigniter & angularjs and trying to find the best way to use both, I have read many article on the same, what I got is there are two ways one is to create an api in CI and use it in angularjs and second is the one you have mentioned. Please can you tell me which one is better and why?
    Also there is one spelling mistake, in controller angularjs.php in index function, to load the view you mentioned the filename “angularjs_view.php” whereas it should be “angular_view.php”.
    Hoping to hear from you.
    If it is comfortable with you mail me on [email protected]

    • Hi Raghav thanks for the comments. Yes there is a typo I have updated it. I, personally, prefer creating an api because it is more elegant and it’s totally separates the backed piece.

  • Nishant Raval

    thanks… i am beginner in codeigniter and starting angular js good tutorial……….

    • I am glad to hear from you.

  • Girish

    Hello Arjun i am using Sb admin Angular Theme in codeignitor but this code is not work in

  • Mitukula Venkatesh

    hi,
    Instead of json can we use mysql db from the model. How the action flow from form action. If i want to fire a action from front-end to controller how i can send action

  • Bipin S.V.

    Hi arjun
    big thanks for ur help. I am one of the beginner . I need your help.

  • Jagdish Chaudhary

    Demo Is not working. Can you check it?

  • Anil Mhaske

    Hi Arjun
    I am one of the beginner.
    Can you please show demo of update record functionality in codeIgniter using Angularjs.

DMCA.com Protection Status