Skip to content

Instantly share code, notes, and snippets.

@desaroxx
Created December 12, 2015 23:49
Show Gist options
  • Save desaroxx/f31096c25200cd5fe8e5 to your computer and use it in GitHub Desktop.
Save desaroxx/f31096c25200cd5fe8e5 to your computer and use it in GitHub Desktop.
namespace pagecontroller {
class HomeController {
public static $inject: Array<string> = ["$timeout"];
public pageTitle: string = "Home";
private name: string = "John Doe";
constructor(private $timeout: ng.ITimeoutService) {}
public sayHello(): void {
this.$timeout(() => {
console.log("HI " + this.makeItUpperCase(this.name));
}, 10);
}
private makeItUpperCase(input: string): string {
return input.toUpperCase();
}
}
angular.module("app", []).controller("homeCtrl", HomeController);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment