Skip to content

Commit

Permalink
Add initial basic angularjs sample
Browse files Browse the repository at this point in the history
  • Loading branch information
mmanela committed Jan 18, 2016
1 parent 615e40e commit eec9e5e
Show file tree
Hide file tree
Showing 20 changed files with 38,433 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ UpgradeLog.*
Chutzpah.sln.DotSettings.user
*.orig
lcov.dat

Samples/Angular/BasicAngular/src/Controller*.js
Samples/Angular/BasicAngular/src/Controller*.map
Samples/Angular/BasicAngular/src/Controller*.d.ts
Samples/Angular/BasicAngular/tests/Controller*.js
Samples/Angular/BasicAngular/tests/Controller*.map
Samples/Angular/BasicAngular/tests/Controller*.d.ts
!Samples/Angular/BasicAngular/src/Controller.ts
!Samples/Angular/BasicAngular/tests/ControllerTests.ts
Samples/Compilation/TypeScriptToSingleFileExceptForTests/test/*.js
Samples/Compilation/TypeScriptToSingleFileExceptForTests/test/*.d.ts
Samples/Compilation/TypeScriptToSingleFileExceptForTests/test/*.map
4 changes: 4 additions & 0 deletions Facts.Integration/TestPathGroups.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ public static IEnumerable<object[]> ChutzpahSamples
new object[] {@"Samples\Settings\Inheritance\PathInheritance\Multiplication\chutzpah.json",2},
new object[] {@"Samples\Settings\Inheritance\PathInheritance\Power\chutzpah.json",2},


// Angular Samples
new object[] {@"Samples\Angular\BasicAngular\tests\chutzpah.json",1},

};
}
}
Expand Down
2 changes: 2 additions & 0 deletions Samples/Angular/BasicAngular/compile.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
tsc.cmd %~dp0src/Controller.ts %~dp0tests/ControllerTests.ts --sourcemap --declaration
22 changes: 22 additions & 0 deletions Samples/Angular/BasicAngular/src/Controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/// <reference path="scripts/typings/angularjs/angular-mocks.d.ts" />
/// <reference path="scripts/typings/angularjs/angular.d.ts" />

namespace Example {
export class Controller {
private $http: angular.IHttpService
public someResponse: number;
constructor($http: angular.IHttpService) {
this.$http = $http;
this.someResponse = -1;
}

public DoSomeThing = () => {
this.$http.get("someAddress")
.success((response: number) => {
this.someResponse = response;
}).error(() => {
this.someResponse = -2;
});
}
}
}
Loading

0 comments on commit eec9e5e

Please sign in to comment.