{{disagreed}} <app-voter *ngFor="let voter of voters" [name]="voter" (onVoted)="onVoted($event)"> </app-voter> ` }) export class VoteTakerComponent { agreed = 0; disagreed = 0; voters = ['Mr. IQ', 'Ms. Universe', 'Bombasto']; onVoted(agreed: boolean) { agreed ? this....
{{ jsonTest | json}} 5. limitTo(限制数组长度或字符串长度) limitTo过滤器用来截取数组或字符串,接收一个参数用来指定截取的长度,如果参数是负值,则从数组尾部开始截取。个人觉得这个filter有点鸡肋,首先只能从数组或字符串的开头/尾部进行截取,其次,js原生的函数就可以代替它了,看看怎么用吧: {{ childrenArray...
当然,如果你正在大量组件中使用 Angular 表单,那么将这些逻辑移动到一个基础类会更友好...但是你不需要继承 AbstractBaseComponent,因为不是每个组件都有 form 表单。像下面这样做比较好: abstract class AbstractFormComponent extends AbstractBaseComponent { form: FormGroup; submitted: boolean = false; // a fla...
[placeholder] string '' Set to true [noAutoComplete] boolean false Set to true Set to true [disabled] boolean false When true, it specifies that the component should be disabled [defaultValue] any[] [] Use to set default value autoSelectSingleOption boolean false Auto select a non disabled...
@Component({selector:'categories',templateUrl:'./categories.component.html',styleUrls:['./categories.component.scss']})exportclassCategoriesComponentimplementsOnInit{@Input()cashflowCategories$:CashflowCategory[];newCategory:CashflowCategory=newCashflowCategory();isUpdating$:Observable<boolean>;constructor(...
- The return type of `SwUpdate#activateUpdate` and `SwUpdate#checkForUpdate` changed to `Promise<boolean>`. Although unlikely, it is possible that this change will cause TypeScript type-checking to fail in some cases. If necessary, update your types to account for the new ...
export class PromiseComponent { promiseData: string; constructor() { this.getPromise().then(v => this.promiseData = v); } getPromise(): Promise<string> { return new Promise((resolve, reject) => { setTimeout(() => { resolve('Promise complete!'); ...
import { passBoolean } from 'protractor/built/util'; import { RootComponent } from "../../../shared/component/root.component"; @Component({ selector: 'app-diagram-editor', templateUrl: './diagram-editor.component.html', styleUrls: ['./diagram-editor.component.scss'] ...
[inputAttrs] { [key: string]: string } - no Pass custom attributes to underlying input element [tabIndex] number - no Set tabindex on ng-select [preventToggleOnRightClick] boolean false no Prevent opening of ng-select on right mouse click [keyDownFn] ($event: KeyboardEvent) => bool tru...
sanitize - uses angulars DomSanitizer to sanitize html values - default:false, boolean (only for format="html") onEditorCreated - editor instance <quill-view[content]="content"format="text"theme="snow"></quill-view> QuillViewHTMLComponent - Using angular [innerHTML] (DEPRECATED with quill v2...