{{ section.title }}
' + + '- ' +
+ '
- ' + + ' {{ item.title }}' + + ' ' + + '
diff --git a/public/_includes/_scripts-include.jade b/public/_includes/_scripts-include.jade index 1e0a30a173..e41bf8f3c7 100644 --- a/public/_includes/_scripts-include.jade +++ b/public/_includes/_scripts-include.jade @@ -17,6 +17,7 @@ script(src="https://ajax.googleapis.com/ajax/libs/angular_material/0.8.3/angular script(src="/resources/js/site.js") script(src="/resources/js/controllers/app-controller.js") script(src="/resources/js/directives/cheatsheet.js") +script(src="/resources/js/directives/api-list.js") script(src="/resources/js/directives/bio.js") script(src="/resources/js/directives/bold.js") script(src="/resources/js/directives/code.js") diff --git a/public/docs/js/latest/api/index.jade b/public/docs/js/latest/api/index.jade index dd52c5cf65..d672174832 100644 --- a/public/docs/js/latest/api/index.jade +++ b/public/docs/js/latest/api/index.jade @@ -1,18 +1 @@ -div(ng-cloak).banner - dl.api-key - dt Display: - dd.directive(ng-class='{ active: apiType === "directive" }' ng-click='setType("directive")') Directive - dd.class(ng-class='{ active: apiType === "class" }' ng-click='setType("class")') Class - dd.interface(ng-class='{ active: apiType === "interface" }' ng-click='setType("interface")') Interface - dd.function(ng-class='{ active: apiType === "function" }' ng-click='setType("function")') Function - dd.const(ng-class='{ active: apiType === "const" }' ng-click='setType("const")') Const or Enum - dd.var(ng-class='{ active: apiType === "var" }' ng-click='setType("var")') Variable - input.api-filter(placeholder='Filter', ng-model='apiFilter') -article(class="l-content-small grid-fluid docs-content") - div(ng-repeat='section in apiSections' ng-if="(apiList[section.name] | filter: { title: apiFilter, docType: apiType }).length" ng-cloak) - h3 {{ section.title }} - ul.api-list - li.api-item(ng-repeat='item in apiList[section.name] | filter: { title: apiFilter, docType: apiType }') - a(ng-href='{{ item.path }}') - span(class='symbol {{ item.docType }}') - | {{ item.title }} +api-list(src="api-list.json") \ No newline at end of file diff --git a/public/docs/ts/latest/api/index.jade b/public/docs/ts/latest/api/index.jade index 3f2c8885b8..d672174832 100644 --- a/public/docs/ts/latest/api/index.jade +++ b/public/docs/ts/latest/api/index.jade @@ -1,18 +1 @@ -div(ng-cloak).banner - dl.api-key - dt Display: - dd.directive(ng-class='{ active: appCtrl.apiType === "directive" }' ng-click='appCtrl.setType("directive")') Directive - dd.class(ng-class='{ active: appCtrl.apiType === "class" }' ng-click='appCtrl.setType("class")') Class - dd.interface(ng-class='{ active: appCtrl.apiType === "interface" }' ng-click='appCtrl.setType("interface")') Interface - dd.function(ng-class='{ active: appCtrl.apiType === "function" }' ng-click='appCtrl.setType("function")') Function - dd.const(ng-class='{ active: appCtrl.apiType === "const" }' ng-click='appCtrl.setType("const")') Const or Enum - dd.var(ng-class='{ active: appCtrl.apiType === "var" }' ng-click='appCtrl.setType("var")') Variable - input.api-filter(placeholder='Filter', ng-model='appCtrl.apiFilter') -article(class="l-content-small grid-fluid docs-content") - div(ng-repeat='section in appCtrl.apiSections' ng-if="(appCtrl.apiList[section.name] | filter: { title: appCtrl.apiFilter, docType: appCtrl.apiType }).length" ng-cloak) - h3 {{ section.title }} - ul.api-list - li.api-item(ng-repeat='item in appCtrl.apiList[section.name] | filter: { title: appCtrl.apiFilter, docType: appCtrl.apiType }') - a(ng-href='{{ item.path }}') - span(class='symbol {{ item.docType }}') - | {{ item.title }} +api-list(src="api-list.json") \ No newline at end of file diff --git a/public/resources/css/module/_api.scss b/public/resources/css/module/_api.scss index c54100a270..0bcbc76714 100644 --- a/public/resources/css/module/_api.scss +++ b/public/resources/css/module/_api.scss @@ -21,7 +21,8 @@ content: 'N'; background: #757575; } - &.var:before { + &.var:before, + &.let:before { content: 'V'; background: #9575cd; } diff --git a/public/resources/js/controllers/app-controller.js b/public/resources/js/controllers/app-controller.js index 6d5770be5f..4b1e77b8b2 100644 --- a/public/resources/js/controllers/app-controller.js +++ b/public/resources/js/controllers/app-controller.js @@ -1,15 +1,11 @@ /* - * Apllication Controller + * Application Controller * */ angularIO.controller('AppCtrl', ['$mdDialog', '$timeout', '$http', '$sce', function ($mdDialog, $timeout, $http, $sce) { var vm = this; - $http.get('/resources/js/app-data.json').then(function(response) { - vm.apiList = response.data; - }); - vm.showDocsNav = false; vm.showMainNav = false; vm.showMenu = false; @@ -29,11 +25,6 @@ angularIO.controller('AppCtrl', ['$mdDialog', '$timeout', '$http', '$sce', funct vm.showMenu = !vm.showMenu; }; - vm.setType = function (type) { - if (type === vm.apiType) vm.apiType = ''; - else vm.apiType = type; - }; - vm.openFeedback = function() { var configuration = { 'productId': '410509', @@ -43,21 +34,6 @@ angularIO.controller('AppCtrl', ['$mdDialog', '$timeout', '$http', '$sce', funct userfeedback.api.startFeedback(configuration); }; - vm.apiSections = [ - { name: 'angular2/core', title: 'angular2/core' }, - { name: 'angular2/common', title: 'angular2/common' }, - { name: 'angular2/animate', title: 'angular2/animate' }, - { name: 'angular2/http', title: 'angular2/http' }, - { name: 'angular2/http/testing', title: 'angular2/http/testing' }, - { name: 'angular2/instrumentation', title: 'angular2/instrumentation' }, - { name: 'angular2/platform/browser', title: 'angular2/platform/browser' }, - { name: 'angular2/router', title: 'angular2/router' }, - { name: 'angular2/router/testing', title: 'angular2/router/testing' }, - { name: 'angular2/testing', title: 'angular2/testing' } - ]; - vm.apiType = ''; - vm.apiFilter = ''; - /* * Prettify Code * diff --git a/public/resources/js/directives/api-list.js b/public/resources/js/directives/api-list.js new file mode 100644 index 0000000000..621d0526b2 --- /dev/null +++ b/public/resources/js/directives/api-list.js @@ -0,0 +1,66 @@ +angularIO.directive('apiList', function () { + return { + restrict: 'E', + template: + '
' + + '