@@ -11,8 +11,7 @@ angular.module('tutorials', [])
11
11
scope : { } ,
12
12
template :
13
13
'<a ng-href="tutorial/{{prev}}"><li class="btn btn-primary"><i class="glyphicon glyphicon-step-backward"></i> Previous</li></a>\n' +
14
- // '<a ng-href="http://angular.github.io/angular-phonecat/step-{{seq}}/app"><li class="btn btn-primary"><i class="glyphicon glyphicon-play"></i> Live Demo</li></a>\n' +
15
- '<a ng-href="https://github.com/angular/angular-phonecat/compare/pre-v1.5.0-snapshot~{{diffLo}}...pre-v1.5.0-snapshot~{{diffHi}}"><li class="btn btn-primary"><i class="glyphicon glyphicon-search"></i> Code Diff</li></a>\n' +
14
+ '<a ng-href="https://github.com/angular/angular-phonecat/compare/old-step-{{diffLo}}...old-step-{{diffHi}}"><li class="btn btn-primary"><i class="glyphicon glyphicon-search"></i> Code Diff</li></a>\n' +
16
15
'<a ng-href="tutorial/{{next}}"><li class="btn btn-primary">Next <i class="glyphicon glyphicon-step-forward"></i></li></a>' ,
17
16
link : function ( scope , element , attrs ) {
18
17
var seq = 1 * attrs . docTutorialNav ;
@@ -21,7 +20,8 @@ angular.module('tutorials', [])
21
20
scope . next = pages [ 2 + seq ] ;
22
21
scope . diffLo = 13 - seq ;
23
22
scope . diffHi = 12 - seq ;
24
-
23
+ scope . diffLo = seq ? ( seq - 1 ) : '0~1' ;
24
+ scope . diffHi = seq ;
25
25
element . addClass ( 'btn-group' ) ;
26
26
element . addClass ( 'tutorial-nav' ) ;
27
27
}
@@ -39,12 +39,10 @@ angular.module('tutorials', [])
39
39
'<div class="alert alert-info" ng-show="show">\n' +
40
40
' <p>Reset the workspace to step {{step}}.</p>' +
41
41
' <p><pre>git checkout -f old-step-{{step}}</pre></p>\n' +
42
- // ' <p>Refresh your browser or check out this step online: '+
43
- // '<a href="http://angular.github.io/angular-phonecat/step-{{step}}/app">Step {{step}} Live Demo</a>.</p>\n' +
44
42
' <p>Refresh your browser to see the changes.</p>\n' +
45
43
'</div>\n' +
46
44
'<p>The most important changes are listed below. You can see the full diff on ' +
47
- '<a ng-href="https://github.com/angular/angular-phonecat/compare/pre-v1.5.0-snapshot~{{13 - step}}...pre-v1.5.0-snapshot~{{12 - step}}" title="See diff on Github">GitHub</a>. \n' +
45
+ '<a ng-href="https://github.com/angular/angular-phonecat/compare/old-step-{{step ? ( step - 1) : \'0~1\' }}...old-step-{{ step}}" title="See diff on Github">GitHub</a>\n' +
48
46
'</p>'
49
47
} ;
50
48
} ) ;
0 commit comments