Angular
- 17 ответов
- 0 вопросов
15
Вклад в тег
<ng-container *ngTemplateOutlet="comp"></ng-container>
import 'rxjs/add/observable/interval'
в нужных файлах.import { interval } from 'rxjs/observable/interval';
...
const intervalObs = interval(100);
...
import { Component } from '@angular/core';
import { interval } from 'rxjs/observable/interval';
import { takeWhile, tap } from 'rxjs/operators';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app';
max = 1;
current = 0;
start() {
const intervalObs = interval(100);
intervalObs.pipe(
takeWhile(_ => isFinished),
tap(i => current += 0.1),
).subscribe();
}
this.createForm = this.fb.group({
...
contacts: this.fb.group({
telephones: ['', []],
emails: ['', []],
postals: ['', []]
})
});
<form [formGroup]="createForm">
<div formGroupName="contacts">
...
<input type="text" name="firstName" placeholder="" formControlName="emails">
...
ngOnInit() {
this.route.params.pluck('id').subscribe(id => {
this._PersonService.getPerson(+id).subscribe(person => this.person = person);
});
}