瀏覽代碼

Add restrict to directives

Lily Carpenter 10 年之前
父節點
當前提交
befa6d06d6
共有 2 個文件被更改,包括 4 次插入2 次删除
  1. 2 1
      www/js/directives/note.js
  2. 2 1
      www/js/directives/note_form.js

+ 2 - 1
www/js/directives/note.js

2
   angular.module('bootcampApp')
2
   angular.module('bootcampApp')
3
     .directive('note', function(){
3
     .directive('note', function(){
4
       return {
4
       return {
5
-        templateUrl: 'partials/note.html'
5
+        templateUrl: 'partials/note.html',
6
+        restrict: 'E'
6
       };
7
       };
7
     });
8
     });
8
 })();
9
 })();

+ 2 - 1
www/js/directives/note_form.js

2
   angular.module('bootcampApp')
2
   angular.module('bootcampApp')
3
     .directive('noteForm', function(){
3
     .directive('noteForm', function(){
4
       return {
4
       return {
5
-        templateUrl: 'partials/note_form.html'
5
+        templateUrl: 'partials/note_form.html',
6
+        restrict: 'E'
6
       };
7
       };
7
     });
8
     });
8
 })();
9
 })();