I am just starting to learn Angular.js, and I looked at project.js in the Wire Up example on the Angular home page .
I got confused in the parameters in the controller functions:
function ListCtrl($scope, Projects) { ... } function CreateCtrl($scope, $location, $timeout, Projects) { ... } function EditCtrl($scope, $location, $routeParams, angularFire, fbURL) { angularFire(fbURL + $routeParams.projectId, $scope, 'remote', {}). then(function() { ... }); }
These controller functions are called in routeProvider, but none of the parameters are specified.
$routeProvider. when('/', {controller:ListCtrl, templateUrl:'list.html'}). when('/edit/:projectId', {controller:EditCtrl, templateUrl:'detail.html'}). when('/new', {controller:CreateCtrl, templateUrl:'detail.html'}). otherwise({redirectTo:'/'}); });
The only thing that I can still find, perhaps, is explaining that there is an “Injection Services in Controllers” that explains $location , $timeout , but not the angularFire and fbURL .
My specific questions are:
What can be the parameters of the controller?
Where are controller functions called with their parameters? Or the parameters are not called, but simply connected to the controller, where the association is encountered with a lot of Angular.js magic (if so, can I see the source code on github)?
Where is angularFire indicated?
Like fbURL in a parameter related to:
angular.module('project', ['firebase']). value('fbURL', 'https://angularjs-projects.firebaseio.com/'). factory ...
Is there a place where I can see all the services, for example. $location and $timeout , what does Angular.js provide? (I tried to find the list, but could not.)
angularjs
Alice Oct 08 '13 at 2:40 2013-10-08 02:40
source share