Skip to content

Instantly share code, notes, and snippets.

@vsavkin
Created December 7, 2018 14:34
Show Gist options
  • Save vsavkin/949e43ab1b279c6ee8bdd9649a503661 to your computer and use it in GitHub Desktop.
Save vsavkin/949e43ab1b279c6ee8bdd9649a503661 to your computer and use it in GitHub Desktop.
var TodosComponent = /** @class */ (function () {
function TodosComponent(store) {
this.store = store;
this.todos = this.store.pipe(select('todos'));
}
TodosComponent.ngComponentDef = defineComponent({
type: TodosComponent,
selectors: [["todos-cmp"]],
factory: function TodosComponent_Factory(t) {
return new (t || TodosComponent)(directiveInject(Store));
},
consts: 2,
vars: 3,
template: function TodosComponent_Template(rf, ctx) {
if (rf & 1) {
pipe(1, "async");
template(0, TodosComponent_div_Template_0, 2, 1, null, _c0);
} if (rf & 2) {
elementProperty(0, "ngForOf", bind(pipeBind1(1, 1, ctx.todos)));
}
},
encapsulation: 2,
features: [fromStore({todos})] // <---------------------- Add it here
});
return TodosComponent;
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment