← BYTES
AngularJS·Starter·Ref: 5.1.19

What is the basic syntax for declaring a controller on a module, e.g. myApp.controller(...)​?

Have a question about this video? Mention reference 5.1.19 when you contact us.

a.myApp.controller() takes only a function with no name
b.myApp.controller() replaces the need for ng-controller entirely
c.myApp.controller() can only be called once per application
d.myApp.controller("MyCtrl", function($scope) { ... }) registers a named controller constructor function on that module
Registering a controller associates a string name with a constructor function on a specific module; that name is what you then reference in ng-controller="MyCtrl" (or in route/component configuration) to actually use it.

Find this on YouTube & Instagram

Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:

#BYTES#BYTES5119#AngularJS