@@ -82,15 +82,8 @@ angular.module('doks', ['mgcrea.ngStrap', 'ui.router', 'ui.select', 'ncy-angular
8282 . split ( '%filePath' ) . join ( dok . filePath ) ;
8383 } ;
8484
85- var cleanList = function ( list ) {
86- return _ . uniq ( _ . compact ( list ) ) ;
87- } ;
88-
89- var filterArray = function ( dataSet , configKey ) {
90- return cleanList ( _ . map ( dataSet , function ( item ) {
91- var key = item [ $scope . config . keys [ configKey ] ] ;
92- return key ? key . basicInfo : null ;
93- } ) ) ;
85+ var filterArray = function ( dataSet ) {
86+ return _ . pluck ( dataSet , '_name' ) ;
9487 } ;
9588
9689 var orderArray = function ( mainKey , subKey , nameKey ) {
@@ -145,15 +138,9 @@ angular.module('doks', ['mgcrea.ngStrap', 'ui.router', 'ui.select', 'ncy-angular
145138 $http . get ( 'output.json' )
146139 . success ( function ( data ) {
147140 $scope . data = data ;
141+ $scope . categories = filterArray ( $scope . data . parsed ) ;
148142 } ) ;
149143 } ) ;
150-
151- $scope . $watch ( 'data' , function ( newVal , oldVal ) {
152- if ( newVal === oldVal ) return ;
153-
154- $scope . categories = filterArray ( $scope . data . parsed , 'category' ) ;
155- $scope . orderedData = orderArray ( 'category' , 'mainType' , 'subType' ) ;
156- } ) ;
157144 } ] )
158145
159146 . controller ( 'Content' , [ '$scope' , '$stateParams' , '$state' , function ( $scope , $stateParams , $state ) {
0 commit comments