← BYTES
AngularJS·Starter·Ref: 5.1.15

What is the typical signature of a basic AngularJS controller function?

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

a.A function that takes no arguments at all, ever
b.A function that can only be called from HTML, never from JavaScript
c.A function that must return a Promise
d.A function that takes $scope (and optionally other injected dependencies) as its argument(s) and attaches data/methods to it
A controller is just a constructor function; AngularJS calls it with whatever dependencies you declare as parameters (most commonly $scope), and the function's job is to populate that $scope with the data and behavior the view needs.

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#BYTES5115#AngularJS