日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

如何在Component template函数执行时查看ɵɵtemplate或者ɵɵproperty传入的参数值

發布時間:2023/12/19 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 如何在Component template函数执行时查看ɵɵtemplate或者ɵɵproperty传入的参数值 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

在觀察template執行的時候,如下圖所示:展開ng-template時:

會觸發函數??property的執行:

/*** @license* Copyright Google LLC All Rights Reserved.** Use of this source code is governed by an MIT-style license that can be* found in the LICENSE file at https://angular.io/license*/ /*** Update a property on a selected element.** Operates on the element selected by index via the {@link select} instruction.** If the property name also exists as an input property on one of the element's directives,* the component property will be set instead of the element property. This check must* be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled** @param propName Name of property. Because it is going to DOM, this is not subject to* renaming as part of minification.* @param value New value to write.* @param sanitizer An optional function used to sanitize the value.* @returns This function returns itself so that it may be chained* (e.g. `property('name', ctx.name)('title', ctx.title)`)** @codeGenApi*/ function ??property(propName, value, sanitizer) {const lView = getLView();const bindingIndex = nextBindingIndex();if (bindingUpdated(lView, bindingIndex, value)) {const tView = getTView();const tNode = getSelectedTNode();elementPropertyInternal(tView, tNode, lView, propName, value, lView[RENDERER], sanitizer, false);ngDevMode && storePropertyBindingMetadata(tView.data, tNode, propName, bindingIndex);}return ??property; }

如果想查看第二行layoutName$變量的值,在debugger里查看arguments:

展開source:

source._value里的header就是layoutName$準備emit出去的值。

更多Jerry的原創文章,盡在:“汪子熙”:

總結

以上是生活随笔為你收集整理的如何在Component template函数执行时查看ɵɵtemplate或者ɵɵproperty传入的参数值的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。