Angular 依赖性注入 changeDetection 可拖拽的属性型指令
发布时间:2020-12-17 08:24:29 所属栏目:安全 来源:网络整理
导读:4.1 依赖性注入 令牌 构建 依赖 Injector Provider Object 难。。 4.2 changeDetection 检查变化的策略:默认:全局检查, 改为onpush策略,减少全局检查的频率,大应用可以以此提高性能 (changeDetection:ChangeDetectionStrategy.OnPush) 然后在constructor
4.1 依赖性注入 4.2 changeDetection constructor(...,private cd:ChangeDetectorRef )
xx(){
...
this.cd,markForCheck();
}
4.3 指令 Renderer2 和 ElementRef drag-drop 拖拽 Can't bind to 'app-draggable' since it isn't a known property of 'mat-list-item'. 1. If 'mat-list-item' is an Angular component and it has 'app-draggable' input,then verify that it is part of this module. 2. If 'mat-list-item' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. 3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. (" 'priority-emergency':item.priority===1 }" [ERROR ->][app-draggable]="true" [draggedClass]="drag-start" (click)="onItemClick()" "): ng:///TaskModule/TaskItemComponent.html@7:2 --->莫名其妙 多保存几次就好了 [app-draggable]="true" [draggedClass]="'drag-start'" 不加''会认为是成员变量,找不到就是undefined (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |