Meaning of the empty array in angularJS module declaration

前端 未结 3 1375
眼角桃花
眼角桃花 2021-02-08 19:28

In my previous question, I understand that the code var app = angular.module(\'myApp\', []); connects the module app to the view myApp.

3条回答
  •  我寻月下人不归
    2021-02-08 19:51

    angular.module('app', []) is to create a new module without any module dependency.

    angular.module('app') is to retrieve an existing module whose name is app.

提交回复
热议问题