Hi all can anyone tell me if i can insert custom html in a directive?
Saisissez le code ici...
import { Directive, Input } from '@angular/core';
import { TemplateRef, ViewContainerRef, ViewRef } from '@angular/core';
@Directive({ selector: '[ibanCheck]' })
export class IbanCheckDirective {
private viewMap: Map<any, ViewRef> = new Map<any, ViewRef>();
constructor(
private templateRef: TemplateRef<any>,
private viewContainer: ViewContainerRef
) { }
@Input() set ibanCheck(inputValue: string) {
this.viewContainer.createEmbeddedView(this.templateRef);//I want to
return this template ref and a custom html
if (this.viewContainer.length > 1)
this.viewContainer.remove(this.viewContainer.length - 1);
}
}
Thank you!
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.