Add macro

This commit is contained in:
NejcZdovc
2016-10-21 08:42:44 +02:00
committed by József Farkas
parent 3a69726257
commit b5eb8601e2
21 changed files with 112 additions and 47 deletions

View File

@@ -26,5 +26,15 @@ export class MacroEffects {
}
});
@Effect({dispatch: false}) add$: any = this.actions$
.ofType(MacroActions.ADD)
.withLatestFrom(this.store)
.do((latest) => {
let state: AppState = latest[1];
let id: number = state.macros.entities.length - 1;
this.router.navigate(['/macro', id, 'new']);
});
constructor(private actions$: Actions, private router: Router, private store: Store<AppState>) {}
}