Skip to content

Commit 54b910c

Browse files
Jed Maoprotomouse
Jed Mao
authored and
protomouse
committed
Add type information where it wasn't before
1 parent 6849c15 commit 54b910c

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

templates/typescript/controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module <%= scriptAppName %> {
99

1010
export class <%= classedName %>Ctrl {
1111

12-
constructor (private $scope:I<%= classedName %>Scope) {
12+
constructor (private $scope: I<%= classedName %>Scope) {
1313
$scope.awesomeThings = [
1414
'HTML5 Boilerplate',
1515
'AngularJS',

templates/typescript/decorator.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
'use strict';
44

5-
module <%= scriptAppName %>{
6-
export function <%= cameledName %>DecoratorProvider($provide:ng.auto.IProvideService):void {
5+
module <%= scriptAppName %> {
6+
export function <%= cameledName %>DecoratorProvider($provide: ng.auto.IProvideService): void {
77
//decorate <%= cameledName %>
88
$provide.decorator('<%= cameledName %>', <%= cameledName %>Decorator);
99
}
1010

11-
export function <%= cameledName %>Decorator($delegate) {
11+
export function <%= cameledName %>Decorator($delegate: ng.ILogService) {
1212
// decorate the $delegate
1313
return $delegate;
1414
}

templates/typescript/directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module <%= scriptAppName %> {
77
export class <%= classedName %> implements ng.IDirective {
88
template = '<div></div>';
99
restrict = 'E';
10-
link = (scope, element: JQuery, attrs: ng.IAttributes):void => {
10+
link = (scope: ng.IScope, element: ng.IAugmentedJQuery, attrs: ng.IAttributes): void => {
1111
element.text('this is the <%= cameledName %> directive');
1212
}
1313
}

templates/typescript/filter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
'use strict';
44

55
module <%= scriptAppName %> {
6-
export function <%= cameledName %>FilterFactory():Function {
6+
export function <%= cameledName %>FilterFactory(): Function {
77
return <%= cameledName %>Filter;
88
}
99

templates/typescript/service/provider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
module <%= scriptAppName %> {
66

7-
var salutation:string;
7+
var salutation: string;
88

99
export class Greeter {
1010
greet = () => salutation;
@@ -14,7 +14,7 @@ module <%= scriptAppName %> {
1414
$get = () => new Greeter();
1515

1616
// Public API for configuration
17-
setSalutation = (s:string) => salutation = s;
17+
setSalutation = (s: string) => salutation = s;
1818
}
1919

2020
}

templates/typescript/spec/controller.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ describe('Controller: <%= classedName %>Ctrl', () => {
99
// load the controller's module
1010
beforeEach(module('<%= scriptAppName %>'));
1111

12-
var <%= classedName %>Ctrl,
13-
scope;
12+
var <%= classedName %>Ctrl: <%= scriptAppName %>.<%= classedName %>Ctrl,
13+
scope: <%= scriptAppName %>.I<%= classedName %>Scope;
1414

1515
// Initialize the controller and a mock scope
16-
beforeEach(inject(($controller, $rootScope) => {
17-
scope = $rootScope.$new();
16+
beforeEach(inject(($controller: ng.IControllerService, $rootScope: ng.IRootScopeService) => {
17+
scope = <any>$rootScope.$new();
1818
<%= classedName %>Ctrl = $controller('<%= classedName %>Ctrl', {
1919
$scope: scope
2020
});

templates/typescript/spec/directive.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ describe('Directive: <%= cameledName %>', () => {
99
// load the directive's module
1010
beforeEach(module('<%= scriptAppName %>'));
1111

12-
var element,
13-
scope;
12+
var element: JQuery,
13+
scope: ng.IScope;
1414

15-
beforeEach(inject(($rootScope) => {
15+
beforeEach(inject(($rootScope: ng.IRootScopeService) => {
1616
scope = $rootScope.$new();
1717
}));
1818

19-
it('should make hidden element visible', inject(($compile) => {
19+
it('should make hidden element visible', inject(($compile: ng.ICompileService) => {
2020
element = angular.element('<<%= _.dasherize(name) %>></<%= _.dasherize(name) %>>');
2121
element = $compile(element)(scope);
2222
expect(element.text()).toBe('this is the <%= cameledName %> directive');

0 commit comments

Comments
 (0)