@hicoder/angular-cli
Version:
Angular UI componenets and service generator. It works with the mean-rest-express package to generate the end to end web application. The input to this generator is the Mongoose schema defined for the express application. mean-rest-express exposes the Res
36 lines (30 loc) • 1.15 kB
text/typescript
import { Component, OnInit, AfterViewInit, Input } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Injector } from '@angular/core';
import { <%-SchemaName%>Service } from '../<%-schemaName%>.service';
import { <%-SchemaName%>DetailComponent } from './<%-schemaName%>-detail.component';
({
<%- include(`/widgets/detail/component.template.custom.ts`)%>
})
export class <%-SchemaName%><%-ComponentClassName%>Component extends <%-SchemaName%>DetailComponent implements OnInit, AfterViewInit {
// @Input() public options: any = {}; // {largePicture: true, notShowTitle: true};
// @Input() public style: any = {}; // { picture: {height: '16rem'}, title: {}, intro: {} }
constructor(
public override <%-schemaName%>Service: <%-SchemaName%>Service,
public override injector: Injector,
public override route: ActivatedRoute,
) {
super(<%-schemaName%>Service, injector, route);
}
override ngOnInit() {
if (!this.options) {
this.options = {
largePicture: true,
};
}
super.ngOnInit();
}
override ngAfterViewInit() {
super.ngAfterViewInit();
}
}