Why ng-app not ng-module?

前端 未结 3 2171
故里飘歌
故里飘歌 2021-02-18 16:25

I understand that ng-app initializes a module in AngularJS as follows:

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

B

3条回答
  •  终归单人心
    2021-02-18 16:57

    ng-app means: That page has Angular in it!

    ng-app="module" means: That page has Angular in it and necessary controls/services/etc are defined in that module.

提交回复
热议问题