Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgol/300506354640c04a89764ee022b891c2 to your computer and use it in GitHub Desktop.
Save mgol/300506354640c04a89764ee022b891c2 to your computer and use it in GitHub Desktop.
import template from './my-dummy.html';
import './my-dummy.scss';
const deps = new WeakMap();
class MyDummyController {
constructor($timeout, $q) {
'ngInject';
deps.set(this, {$timeout, $q});
}
doSomething() {
const {$timeout, $q} = deps.get(this);
/*
* Do something with $timeout & $q.
*/
}
}
const myDummyComponent = {
bindings: {
$router: '<',
},
template,
controller: MyDummyController,
};
angular
.module('myDummy', [])
.component('myDummy, myDummyComponent);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment