11DocsApp
22. directive ( 'layoutAlign' , function ( ) { return angular . noop ; } )
33. directive ( 'layout' , function ( ) { return angular . noop ; } )
4- . directive ( 'docsDemo' , [
5- '$mdUtil' ,
6- function ( ) {
4+ . directive ( 'docsDemo' , [ '$mdUtil' , function ( $mdUtil ) {
75 return {
86 restrict : 'E' ,
97 scope : true ,
@@ -14,22 +12,17 @@ function() {
1412 bindToController : true
1513 } ;
1614
17- function DocsDemoCtrl ( $scope , $element , $attrs , codepen ) {
15+ function DocsDemoCtrl ( $scope , $element , $attrs , $interpolate , codepen ) {
1816 var self = this ;
1917
2018 self . interpolateCode = angular . isDefined ( $attrs . interpolateCode ) ;
19+ self . demoId = $interpolate ( $attrs . demoId || '' ) ( $scope . $parent ) ;
20+ self . demoTitle = $interpolate ( $attrs . demoTitle || '' ) ( $scope . $parent ) ;
21+ self . demoModule = $interpolate ( $attrs . demoModule || '' ) ( $scope . $parent ) ;
2122
22- $attrs . $observe ( 'demoTitle' , function ( value ) {
23- self . demoTitle = value ;
24- } ) ;
25-
26- $attrs . $observe ( 'demoId' , function ( value ) {
27- self . demoId = value ;
28- } ) ;
29-
30- $attrs . $observe ( 'demoModule' , function ( value ) {
31- self . demoModule = value ;
32- } ) ;
23+ $attrs . $observe ( 'demoTitle' , function ( value ) { self . demoTitle = value || self . demoTitle ; } ) ;
24+ $attrs . $observe ( 'demoId' , function ( value ) { self . demoId = value || self . demoId ; } ) ;
25+ $attrs . $observe ( 'demoModule' , function ( value ) { self . demoModule = value || self . demoModule ; } ) ;
3326
3427 self . files = {
3528 css : [ ] , js : [ ] , html : [ ]
0 commit comments