
committed by
Igor Minar

parent
344a5ca545
commit
9bbf009dff
@ -2,9 +2,9 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'my-app',
|
||||
template: `<hero-form-template></hero-form-template>
|
||||
selector: 'app-root',
|
||||
template: `<app-hero-form-template></app-hero-form-template>
|
||||
<hr>
|
||||
<hero-form-reactive></hero-form-reactive>`
|
||||
<app-hero-form-reactive></app-hero-form-reactive>`
|
||||
})
|
||||
export class AppComponent { }
|
||||
|
@ -6,7 +6,7 @@ import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { forbiddenNameValidator } from '../shared/forbidden-name.directive';
|
||||
|
||||
@Component({
|
||||
selector: 'hero-form-reactive',
|
||||
selector: 'app-hero-form-reactive',
|
||||
templateUrl: './hero-form-reactive.component.html'
|
||||
})
|
||||
export class HeroFormReactiveComponent implements OnInit {
|
||||
|
@ -14,7 +14,7 @@ export function forbiddenNameValidator(nameRe: RegExp): ValidatorFn {
|
||||
|
||||
// #docregion directive
|
||||
@Directive({
|
||||
selector: '[forbiddenName]',
|
||||
selector: '[appForbiddenName]',
|
||||
// #docregion directive-providers
|
||||
providers: [{provide: NG_VALIDATORS, useExisting: ForbiddenValidatorDirective, multi: true}]
|
||||
// #enddocregion directive-providers
|
||||
|
@ -4,7 +4,7 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'hero-form-template',
|
||||
selector: 'app-hero-form-template',
|
||||
templateUrl: './hero-form-template.component.html'
|
||||
})
|
||||
export class HeroFormTemplateComponent {
|
||||
|
Reference in New Issue
Block a user