blob: 96fba9cc66218654be23c597f251a752346d2d04 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
SyntaxHighlighter['defaults'].toolbar = false;
DocsController.$inject = ['$location', '$browser'];
function DocsController($location, $browser) {
this.pages = NG_PAGES;
window.$root = this.$root;
this.getUrl = function(page){
return '#!' + encodeURIComponent(page.name);
};
this.getCurrentPartial = function(){
return './' + this.getTitle() + '.html';
};
this.getTitle = function(){
var hashPath = $location.hashPath || '!angular';
if (hashPath.match(/^!angular/)) {
this.partialTitle = hashPath.substring(1);
}
return this.partialTitle;
};
this.getClass = function(page) {
var depth = page.name.split(/\./).length - 1;
return 'level-' + depth +
(page.name == this.getTitle() ? ' selected' : '');
};
}
angular.filter('short', function(name){
return (name||'').split(/\./).pop();
});
|