fuse-angular/src/app/main/content/components/angular-material/angular-material.component.ts

33 lines
825 B
TypeScript
Raw Normal View History

import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { COMPONENT_MAP } from './example-components';
@Component({
selector : 'fuse-angular-material',
templateUrl: './angular-material.component.html',
styleUrls : ['./angular-material.component.scss']
})
export class FuseAngularMaterialComponent implements OnInit
{
id: string;
title: string;
examples: any;
constructor(
private route: ActivatedRoute
)
{
}
ngOnInit()
{
this.route.params.subscribe(params => {
this.id = params['id'];
const _title = this.id.replace('-', ' ');
this.title = _title.charAt(0).toUpperCase() + _title.substring(1);
this.examples = COMPONENT_MAP[this.id];
});
}
}