Sometimes I see code that looks like this in Angular:
define(['angular', 'module'], function (angular, module) {
//...
});
What does this do? Whenever I've tried to search for "angularjs define" or "angularjs define function" I see results like "How to define a function in AngularJS" or "AngularJS Defined."
This happens with search engines, and typing this into the search box on the AngularJS website doesn't help either.
Where is the documentation for this?
Definition of angular 1a : forming an angle : sharp-cornered. b : having one or more angles. 2 : measured by an angle angular distance. 3a : stiff in character or manner : lacking smoothness or grace. b : lean and having prominent bone structure.
js. var app = angular. module("myApp", []); The [] parameter in the module definition can be used to define dependent modules.
In AngularJS, a Controller is defined by a JavaScript constructor function that is used to augment the AngularJS Scope. Controllers can be attached to the DOM in different ways.
Its probably because you're assuming its an Angular function. I believe this is RequireJS.
http://requirejs.org/docs/api.html#define
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With