Skip to content

Instantly share code, notes, and snippets.

@jonocairns
Last active August 29, 2015 14:20
Show Gist options
  • Save jonocairns/db99666913fd4a0e8b58 to your computer and use it in GitHub Desktop.
Save jonocairns/db99666913fd4a0e8b58 to your computer and use it in GitHub Desktop.
template for an angular controller - written in typescript
'use strict';
module app.common {
export interface IExampleController {
doSomething(value: string): void;
}
class ExampleController {
// properties here
public exampleProp: boolean;
static $inject = ['someService'];
constructor(private someService) {
}
// methods here
public doSomething(value: string): void {
var test = 1 + 1;
console.log(test);
}
}
angular
.module('app.common')
.controller('app.common.ExampleController', ExampleController);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment