Last active
August 29, 2015 14:20
-
-
Save jonocairns/db99666913fd4a0e8b58 to your computer and use it in GitHub Desktop.
template for an angular controller - written in typescript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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