littleuniversestudios / angular-cli-tools

Command Line Tools for Angular 2 projects
MIT License
30 stars 8 forks source link

Passing in Additional values #13

Closed KhoaSydney closed 7 years ago

KhoaSydney commented 7 years ago

Hi @nvitas How do I pass in additional value or string? For example from the below template:

import { Component, Directive, ElementRef, Injector } from "@angular/core";
import { UpgradeComponent } from '@angular/upgrade/static';
import NavigationPath from "route/navigation.path";

@Directive({
    selector: 'mw-$name$'
})
export class $PascalCaseName$UpgradedDirective extends UpgradeComponent {
    constructor(elementRef: ElementRef, injector: Injector) {
        super(NavigationPath.Modelling_NeedsAnalysis_ClientDetails.controllerId, elementRef, injector);
    }
}

@Component({
    selector: "$name$",
    template:"<mw-$name$></mw-$name$>"
})
export class $PascalCaseName$Component {

}

As you can see from the super constructor I need to pass in NavigationPath.Modelling_NeedsAnalysis_ClientDetails.controllerId. This will be different for each Component. Is it possible to pass this value into the template beside the Name?

cheers,

nvitas commented 7 years ago

Hey @KhoaSydney,

not possible at the moment but let me think about it...We haven't had a need for that use case but I'll look into it and see if we can come up with something.