No macro text and route update
This commit is contained in:
committed by
József Farkas
parent
f887dc8a96
commit
03ca90d558
@@ -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>
|
||||
@@ -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')
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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',
|
||||
|
||||
1
src/components/macro/not-found/index.ts
Normal file
1
src/components/macro/not-found/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { MacroNotFoundComponent} from './macro-not-found.component';
|
||||
@@ -0,0 +1,3 @@
|
||||
<div class="not-found">
|
||||
You don't have any macros. Try to add one!
|
||||
</div>
|
||||
@@ -0,0 +1,5 @@
|
||||
.not-found {
|
||||
margin-top: 30px;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
@@ -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 { }
|
||||
Reference in New Issue
Block a user