Last active
May 10, 2017 09:18
-
-
Save ondrasak/2fe34198c8c7539d21ddbd7abdd80f9c to your computer and use it in GitHub Desktop.
icon.ts
This file contains hidden or 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
| import * as angular from "angular"; | |
| class Icon { | |
| color: string; | |
| constructor( | |
| private $element | |
| ) { | |
| "ngInject"; | |
| } | |
| getIcon() { | |
| return new Promise((resolve, reject) => { | |
| require.ensure([], (require) => { | |
| let icon = require.context("svg-inline-loader!./icon-files", false, (/.*/g)); | |
| resolve(icon); | |
| }); | |
| }); | |
| } | |
| $onInit() { | |
| // TODO | |
| } | |
| } | |
| angular.module("components.icon", []) | |
| .component("sdaIcon", { | |
| controller: Icon, | |
| template: require("./icon.html"), | |
| bindings: { | |
| color: "=" | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment