Skip to content

Instantly share code, notes, and snippets.

@ssougnez
Created July 15, 2018 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssougnez/76dbc34483c08a012198cc666b520864 to your computer and use it in GitHub Desktop.
Save ssougnez/76dbc34483c08a012198cc666b520864 to your computer and use it in GitHub Desktop.
import { CustomDataService } from "../services/custom-data.service";
const template = require("./custom-data.component.html");
class CustomDataController {
static $inject = ["customData"];
public data: string[] = [];
constructor(private _customData: CustomDataService) {}
public async $onInit(): Promise<void> {
this.data = await this._customData.getData();
}
}
export class CustomDataComponent implements ng.IComponentOptions {
public controller: any;
public templateUrl: string;
constructor() {
this.controller = CustomDataController;
this.templateUrl = template;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment