No macro text and route update

This commit is contained in:
Farkas József
2016-12-05 17:44:51 +01:00
committed by József Farkas
parent f887dc8a96
commit 03ca90d558
11 changed files with 28 additions and 14 deletions

View File

@@ -13,5 +13,5 @@
</template>
<div *ngIf="!macro" class="not-found">
Sorry, there is no macro with this id.
There is no macro with id {{ route.params.select('id') | async }}.
</div>

View File

@@ -25,7 +25,7 @@ export class MacroEditComponent implements OnDestroy {
private macro: Macro;
private isNew: boolean;
constructor(private store: Store<AppState>, private route: ActivatedRoute) {
constructor(private store: Store<AppState>, public route: ActivatedRoute) {
this.subscription = route
.params
.select<string>('id')

View File

@@ -2,6 +2,7 @@ export * from './edit/macro-edit.component';
export * from './list/macro-list.component';
export * from './header/macro-header.component';
export * from './macro.routes';
export * from './not-found';
export * from './item';
export * from './action-editor';
export * from './action-editor/tab';

View File

@@ -1,11 +1,12 @@
import { Routes } from '@angular/router';
import { MacroEditComponent } from './edit/macro-edit.component';
import { MacroNotFoundComponent } from './not-found';
export const macroRoutes: Routes = [
{
path: 'macro',
component: MacroEditComponent
component: MacroNotFoundComponent
},
{
path: 'macro/:id',

View File

@@ -0,0 +1 @@
export { MacroNotFoundComponent} from './macro-not-found.component';

View File

@@ -0,0 +1,3 @@
<div class="not-found">
You don't have any macros. Try to add one!
</div>

View File

@@ -0,0 +1,5 @@
.not-found {
margin-top: 30px;
font-size: 16px;
text-align: center;
}

View File

@@ -0,0 +1,8 @@
import { Component } from '@angular/core';
@Component({
selector: 'macro-not-found',
template: require('./macro-not-found.component.html'),
styles: [require('./macro-not-found.component.scss')]
})
export class MacroNotFoundComponent { }