Created
July 18, 2018 13:19
-
-
Save ssougnez/ea424e85c3b35d0f04e8fcf757da6938 to your computer and use it in GitHub Desktop.
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
const template = require("./hello-world.component.html"); | |
interface IHelloWorldController extends ng.IScope { | |
data: string; | |
} | |
class HelloWorldController { | |
static $inject = ["$scope"]; | |
constructor(private _scope: IHelloWorldController) { | |
this.$onInit(); | |
} | |
public $onInit() { | |
this._scope.data = "Hello world!"; | |
} | |
} | |
export function HelloWorldComponent(): ng.IDirective { | |
return { | |
restrict: "E", | |
template: template, | |
controller: HelloWorldController | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment