-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathasg-debug.ts
44 lines (31 loc) · 849 Bytes
/
asg-debug.ts
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
namespace angularSuperGallery {
export class DebugController {
public id: string;
private asg: IServiceController;
private type;
private template;
constructor(
private service: IServiceController,
private $scope: ng.IScope) {
this.type = 'info';
this.template = '/views/asg-debug.html';
}
public $onInit() {
// get service instance
this.asg = this.service.getInstance(this);
}
public get file() {
return this.asg ? this.asg.file : null;
}
}
let app: ng.IModule = angular.module('angularSuperGallery');
app.component('asgDebug', {
controller: ['asgService', '$scope', angularSuperGallery.DebugController],
template: '<div class="asg-debug {{ $ctrl.asg.classes }}"><div ng-include="$ctrl.template"></div></div>',
transclude: true,
bindings: {
id: '@?',
template: '@?'
}
});
}