Angularjs-----Create Custom Directives ***attentive points***(Part I)
When creating custom directives, we can use ng-app module or create new modules.
1. Using existing ng-app module:
angular.module('app').directive....
2. Creating a new module:
var appNew = angular.module("app.newModule", []); appNew.directive("newDirective"...)
Pay atttention that in this situation(situation 2) we need to inject the new module into the ng-app module as dependencies.
var app = angular.module('app', ['app.newModule']);
BTW, when reference the js files, your main module js(eg:app.js) must precede all of his children (controller.js and directives.js).

浙公网安备 33010602011771号