Hi Wisdom...,
Your code sample came from an ancient version of angular. That version
allowed for global functions to be used as controller. This bug was fixed
like 2+ years ago.
If you want to use controllers, you have to add them to your module.
Something like this:
var app = angular.module('myApp', []);
app.controller('Ctrl1',function Ctrl1($scope,items) {
$scope.list = items.list;
});
app.controller('Ctrl2', function Ctrl2($scope, items) {
$scope.add = items.add;
});
And even that example is not how it should be done right now.
You really should read through the style-guide
<https://github.com/johnpapa/angular-styleguide>.
Regards
Sander
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.