File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/* use strict */
22var app = angular . module ( 'MyApp' , [ ] ) ;
33
4- app . controller ( 'ShieldCtrl' , function ( $scope )
4+ app . directive ( 'restrictions' , function ( )
5+ {
6+ return {
7+ restrict : 'A' ,
8+ link : function ( )
9+ {
10+ console . log ( 'I am an attribute' ) ;
11+ }
12+ }
13+ } )
14+
15+ . directive ( 'elementrest' , function ( )
16+ {
17+ return {
18+ restrict : 'E' ,
19+ link : function ( )
20+ {
21+ console . log ( 'I am an element' ) ;
22+ }
23+ }
24+ } )
25+
26+ . directive ( 'classrest' , function ( )
27+ {
28+ return {
29+ restrict : 'C' ,
30+ link : function ( )
31+ {
32+ console . log ( 'I am a class' ) ;
33+ }
34+ }
35+ } )
36+
37+ . directive ( 'commentsrest' , function ( )
38+ {
39+ return {
40+ restrict : 'M' ,
41+ link : function ( )
42+ {
43+ console . log ( 'I am a comment restriction' ) ;
44+ }
45+ }
46+ } )
47+
48+ . controller ( 'ShieldCtrl' , function ( $scope )
549{
650 $scope . shieldNames = [ ] ;
751
Original file line number Diff line number Diff line change 1313< body >
1414
1515 < div class ="mainContainer " data-ng-app ="MyApp ">
16+
17+ < div restrictions > Attribute Restriction</ div >
18+
19+ < elementrest > Element Restriction</ elementrest >
20+
21+ < div class ="classrest "> Class Restriction</ div >
22+
23+ <!-- directive:commentsrest -->
24+ < div > </ div >
25+
26+
1627 < walterwhite message ="I am Heisenberg " class ="btn btn-default ">
1728
1829 </ walterwhite >
Original file line number Diff line number Diff line change 11/* use strict */
22var app = angular . module ( 'MyApp' , [ ] ) ;
33
4- app . controller ( 'ShieldCtrl' , function ( $scope )
4+ app . directive ( 'restrictions' , function ( )
5+ {
6+ return {
7+ restrict : 'A' ,
8+ link : function ( )
9+ {
10+ console . log ( 'I am an attribute' ) ;
11+ }
12+ }
13+ } )
14+
15+ . directive ( 'elementrest' , function ( )
16+ {
17+ return {
18+ restrict : 'E' ,
19+ link : function ( )
20+ {
21+ console . log ( 'I am an element' ) ;
22+ }
23+ }
24+ } )
25+
26+ . directive ( 'classrest' , function ( )
27+ {
28+ return {
29+ restrict : 'C' ,
30+ link : function ( )
31+ {
32+ console . log ( 'I am a class' ) ;
33+ }
34+ }
35+ } )
36+
37+ . directive ( 'commentsrest' , function ( )
38+ {
39+ return {
40+ restrict : 'M' ,
41+ link : function ( )
42+ {
43+ console . log ( 'I am a comment restriction' ) ;
44+ }
45+ }
46+ } )
47+
48+ . controller ( 'ShieldCtrl' , function ( $scope )
549{
650 $scope . shieldNames = [ ] ;
751
You can’t perform that action at this time.
0 commit comments