2
schangxiang@126.com
2024-08-16 b47c50a2a514def7374b32d7194b2c599cba5625
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
(function(){
    'use strict';
 
    angular.module('main', ['ngRoute', 'ngTable', 'ngSocial', 'embedCodepen', 'ngSanitize'])
        .config(['$routeProvider',
            function ($routeProvider) {
                $routeProvider.
                    when('/', {
                        templateUrl: 'views/intro/overview.html',
                        controller: 'introController',
                        controllerAs: 'vm'
                    }).
                    when('/demo/todo', {
                        templateUrl: 'views/todo.html',
                        controller: function () {
 
                        }
                    }).
                    when('/:section/:article', {
                        templateUrl: function ($routeParams) {
                            return 'views/' + $routeParams.section + '/' + $routeParams.article + '.html';
                        },
                        controller: function () {
 
                        }
                    });
            }])
        .controller('introController', function(NgTableParams){
            var self = this;
            var data = [{name: "Moroni", age: 50},
                {name: "Simon", age: 43},
                {name: "Jacob", age: 27},
                {name: "Nephi", age: 29},
                {name: "Christian", age: 34},
                {name: "Tiancum", age: 43},
                {name: "Jacob", age: 27}
            ];
            self.tableParams = new NgTableParams({ count: 5}, { counts: [5, 10, 25], dataset: data});
        })
        .directive('prettycode', function() {
            return {
                restrict: 'A',
                scope: {
                    'code': '=prettycode',
                    'prettyLang': '@prettyLang'
                },
                link: function postLink(scope, element, attrs) {
                    scope.$watch('code', function(code) {
                        if (angular.isUndefined(code)) {
                            return;
                        }
                        element.html(hljs.highlight(scope.prettyLang || 'html', code).value);
                    });
                    element.html(hljs.highlight(scope.prettyLang || 'html', element.text()).value);
                }
            };
        })
        .controller('menuController', function(){
            var self = this;
            self.sections = [{
                title: 'Intro',
                hasMore: false,
                url: '#/',
                items: [{
                    title: 'Real world example',
                    url: '#/intro/demo-real-world'
                }]
            }, {
                title: 'Loading data',
                hasMore: false,
                items: [{
                    title: 'Overview',
                    url: '#/loading/overview'
                }, {
                    title: 'Managed array',
                    url: '#/loading/demo-managed-array'
                }, {
                    title: 'Lazy loading managed array',
                    url: '#/loading/demo-lazy-loaded'
                }, {
                    title: 'External array (eg server-side)',
                    url: '#/loading/demo-external-array'
                }]
            }, {
                title: 'Pagination',
                hasMore: true,
                items: [{
                    title: 'Basic example',
                    url: '#/pagination/demo-pager-basic'
                }, {
                    title: 'Change page / page controls programmatically',
                    url: '#/pagination/demo-api'
                }, {
                    title: 'Custom template',
                    url: '#/demo/todo'
                }]
            }, {
                title: 'Sorting',
                hasMore: true,
                items: [{
                    title: 'Basic example',
                    url: '#/sorting/demo-sorting-basic'
                }, {
                    title: 'Change sort order programmatically',
                    url: '#/sorting/demo-api'
                }, {
                    title: 'Enable sorting programmatically',
                    url: '#/sorting/demo-enabling'
                }]
            }, {
                title: 'Filtering',
                hasMore: true,
                items: [{
                    title: 'Basic example',
                    url: '#/filtering/demo-filtering-basic'
                }, {
                    title: 'Nested property filters',
                    url: '#/filtering/demo-nested-property'
                }, {
                    title: 'Select filters',
                    url: '#/filtering/demo-select'
                }, {
                    title: 'Custom filter template',
                    url: '#/filtering/demo-custom-template'
                }, {
                    title: 'Multiple template filters',
                    url: '#/filtering/demo-multi-template'
                }, {
                    title: 'Change filter values programmatically',
                    url: '#/filtering/demo-api'
                }, {
                    title: 'Enable filters programmatically',
                    url: '#/filtering/demo-enabling'
                }, {
                    title: 'Customize filter algorithm',
                    url: '#/filtering/demo-customize-algorithm'
                }]
            }, {
                title: 'Grouping',
                hasMore: true,
                items: [{
                    title: 'Basic example',
                    url: '#/grouping/demo-grouping-basic'
                }, {
                    title: 'Custom grouping function',
                    url: '#/grouping/demo-grouping-fn'
                }, {
                    title: 'Summary row',
                    url: '#/grouping/demo-summary'
                }, {
                    title: 'Change grouping programmatically',
                    url: '#/grouping/demo-api'
                }, {
                    title: 'Enable grouping programmatically',
                    url: '#/grouping/demo-enabling'
                }]
            }, {
                title: 'Formatting table',
                hasMore: true,
                items: [{
                    title: '<em>ngTable</em>: Data cell template',
                    url: '#/formatting/demo-cell-values'
                }, {
                    title: '<em>ngTableDynamic</em>: Data cell template (via JS)',
                    url: '#/formatting/demo-dynamic-js-values'
                }, {
                    title: '<em>ngTableDynamic</em>: Data cell template (via HTML)',
                    url: '#/formatting/demo-dynamic-html-values'
                }, {
                    title: 'Data row template',
                    url: '#/formatting/demo-row'
                }, {
                    title: 'Header cell template - basic',
                    url: '#/formatting/demo-header-cell-basic'
                }, {
                    title: 'Header cell template - full',
                    url: '#/formatting/demo-header-cell-full'
                }, {
                    title: 'Custom header',
                    url: '#/formatting/demo-custom-header'
                }]
            }, {
                title: 'Working with columns',
                hasMore: false,
                items: [{
                    title: 'Show/hide columns',
                    url: '#/columns/demo-visibility'
                }, {
                    title: 'Reorder columns',
                    url: '#/columns/demo-reordering'
                }]
            }, {
                title: 'Editing data',
                hasMore: false,
                items: [{
                    title: 'Inline row edit',
                    url: '#/editing/demo-inline'
                }, {
                    title: 'Batch table edit',
                    url: '#/editing/demo-batch'
                }]
            }, {
                title: 'Events',
                hasMore: false,
                items: [{
                    title: 'Subscribe to events',
                    url: '#/events/demo-subscribe'
                }, {
                    title: 'Unsubscribe from events',
                    url: '#/events/demo-unsubscribe'
                }]
            }, {
                title: 'Global customizations',
                hasMore: false,
                items: [{
                    title: 'Response interceptors',
                    url: '#/demo/todo'
                }, {
                    title: 'Change default parameters and settings',
                    url: '#/demo/todo'
                }, {
                    title: 'Replace default filter/sorting algorithm',
                    url: '#/demo/todo'
                }]
            }, {
                title: 'Miscellaneous',
                hasMore: false,
                items: [{
                    title: 'Saving params in url',
                    url: '#/demo/todo'
                }]
            }, {
                title: 'Plugins',
                hasMore: false,
                items: [{
                    title: 'Resize columns',
                    url: '#/demo/todo'
                }, {
                    title: 'Export to CSV',
                    url: '#/demo/todo'
                }]
            }];
        });
})();