The combination of CodeIgniter and AngularJS helps you create a new range of HTML5 applications .
Unlike JQuery, AngularJS is an interface map that depends on data from the backend, all messages from the front-end come through Controller Methods , there are operations for receiving and publishing in Angular.
CodeIgniter will act as an API that will output a json response to an Angular controller.
I suppose that json_encode(data) will output the required JSON string, which, after the interface receives the Angular data presentation layer, will take care of things / or if you want to perform any operation on the data, Angular can also do this.
I have no references to this combination, because most people switched to a combination of Ruby on Rails and AngularJS , for fear of stopping the new version of CodeIgniter
I regret that you do not have satisfactory blog links / posts. If time allows me to make a proof of concept, I would be very happy to publish the link.
Hope this helps.
EDIT
Json
[ {"title": "t1"}, {"title": "t2"} .... ]
HTML
<body ng-app="app"> <div ng-controller="MsgCtrl"> <ul> <li ng-repeat="m in msg">{{m.title}}</li> </ul> </div> </body>
Js
var app = angular.module("app", []); app.controller("MsgCtrl", function($scope, $http) { $http.get('/index.php/ctrlname/methodname'). success(function(data, status, headers, config) { $scope.msg = data; }). error(function(data, status, headers, config) {
UPDATE
For Insert, Delete, Update with CodeIgniter and AngularJS
CodeIgniter Controller
class Msg extends CI_Controller { public function retrieveall() { .. }
CodeIgniter Routing
$route['m'] = "msg"; $route['m/(:any)'] = "msg/$1";
HTML
<body ng-app="app"> <div ng-controller="MsgCtrl"> <ul> <li ng-repeat="m in msg"> {{m.title}} <a href="#" ng-click="delete(m.id)">Delete</a> <a href="#" ng-click="edit(m.id)">Edit</a> </li> </ul> <input type="text ng-model="create.title"> <button type="submit" ng-click="formsubmit"> Submit </button> <input type="text ng-model="editc.title"> <button type="submit" ng-click="editsubmit(editc.id)"> Submit </button> </div> </body>
Js
var app = angular.module("app", []); app.controller("MsgCtrl", function($scope, $http) { $http.get('/index.php/m/retrieveall'). success(function(data, status, headers, config) { $scope.msg = data; }). error(function(data, status, headers, config) { // log error }); $scope.delete = function($id) { $http.get('/index.php/m/delete/' + $id). success(function(data, status, headers, config) { $scope.result = data; } $scope.edit = function($id) { $http.get('/index.php/m/retrieve/' + $id). success(function(data, status, headers, config) { $scope.editc = data; } $scope.editsubmit = function($id) { $http.get('/index.php/m/update/' + $id +'/' + $scope.editc.title). success(function(data, status, headers, config) { $scope.result = data; } } $scope.formsubmit = function($id) { $http.post('/index.php/m/create', {data: create}). success(function(data, status, headers, config) { $scope.result = data; } } });
I believe this will help you understand. This is a simple example.