angularjs - What is "[ ]" sign in angular.js? -


i trying find answer nothing found... in simple below codes:

var app = angular.module('myapp', [] ); 

i have never seen example using "[ ]" sign. for?

that dependencies array want module depend on.

so if need routing system so:

angular.module("app.module", ["ui.router"]); 

this says app.module depends on ui.router routing.

your example above declaring angular module no dependencies , assign variable app.


Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -