1
1
DocsApp
2
2
. directive ( 'layoutAlign' , function ( ) { return angular . noop ; } )
3
3
. directive ( 'layout' , function ( ) { return angular . noop ; } )
4
- . directive ( 'docsDemo' , [
5
- '$mdUtil' ,
6
- function ( ) {
4
+ . directive ( 'docsDemo' , [ '$mdUtil' , function ( $mdUtil ) {
7
5
return {
8
6
restrict : 'E' ,
9
7
scope : true ,
@@ -14,22 +12,17 @@ function() {
14
12
bindToController : true
15
13
} ;
16
14
17
- function DocsDemoCtrl ( $scope , $element , $attrs , codepen ) {
15
+ function DocsDemoCtrl ( $scope , $element , $attrs , $interpolate , codepen ) {
18
16
var self = this ;
19
17
20
18
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 ) ;
21
22
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 ; } ) ;
33
26
34
27
self . files = {
35
28
css : [ ] , js : [ ] , html : [ ]
0 commit comments