Angular Shadow Root DOM的一些API
2023-09-14 09:02:59 时间
一下子就跳到这个函数ɵɵadvance了:
/**
* Executes post-order init and check hooks (one of AfterContentInit, AfterContentChecked,
* AfterViewInit, AfterViewChecked) given a view where there are pending init hooks to be executed.
* @param {?} lView The LView where hooks are defined
* @param {?} hooks Hooks to be run
* @param {?} initPhase A phase for which hooks should be run
* @param {?=} nodeIndex 3 cases depending on the value:
* - undefined: all hooks from the array should be executed (post-order case)
* - null: execute hooks only from the saved index until the end of the array (pre-order case, when
* flushing the remaining hooks)
* - number: execute hooks only from the saved index until that node index exclusive (pre-order
* case, when executing select(number))
* @return {?}
*/
function executeInitAndCheckHooks(lView, hooks, initPhase, nodeIndex) {
ngDevMode &&
assertNotEqual(initPhase, 3 /* InitPhaseCompleted */, 'Init pre-order hooks should not be called more than once');
if ((lView[FLAGS] & 3 /* InitPhaseStateMask */) === initPhase) {
callHooks(lView, hooks, initPhase, nodeIndex);
}
}
这个NzInputGroupComponent来自:nz-input-group
如何判断当前浏览器是否支持ShadowDom:
/**
* Checks whether the user's browser support Shadow DOM.
* @return {?}
*/
function _supportsShadowDom() {
if (shadowDomIsSupported == null) {
/** @type {?} */
const head = typeof document !== 'undefined' ? document.head : null;
shadowDomIsSupported = !!(head && (((/** @type {?} */ (head))).createShadowRoot || head.attachShadow));
}
return shadowDomIsSupported;
}
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
相关文章
- [Angular 14] Inject() function
- [Angular] Extract Implementation Details of ngrx from an Angular Application with the Facade Pattern
- [Angular] Angular Router Extra Options - Recommended Settings
- [Angular] Angular i18n Alternative Expressions Support (select)
- [AngularJS] Test an Angular Component with $componentController
- [Angular 2] WebStorm - Managing Imports
- [Angular] Parent scope, scope overwritten, using factory() to share data between controller
- Angular HTTPClient API 在 SAP 电商云中的使用
- 关于 Angular 注解 @Injectable() 使用的一些误区
- 用SAP Spartacus 一个实际例子理解Angular <ng-template>的用法和工作原理
- Angular In-memory Web API使用介绍
- angular 设置年份选择下拉框,并默认今年