Angularjs 如何从Typescript中的html中获取此值?
我的html页面上有以下元素:Angularjs 如何从Typescript中的html中获取此值?,angularjs,typescript,Angularjs,Typescript,我的html页面上有以下元素: <div class="section-title" id="bladeSectionTitle" ng-transclude="title"> </div> 视图源提供了以下信息: <dpn-blade-section is-checkbox-visible="true" is-checked="$component.showAll"> <section-tit
<div class="section-title" id="bladeSectionTitle"
ng-transclude="title">
</div>
视图源提供了以下信息:
<dpn-blade-section is-checkbox-visible="true" is-checked="$component.showAll">
<section-title>
<h4>Show All</h4>
</section-title>
全部展示
在本例中,我要查找的值是“全部显示”。您正在运行哪个版本的angular?我们需要更多的信息。虽然直接访问DOM不是angular的方式,但是您看到的是这样的情况
var title=document.querySelector('dpn-blade-section title h4')。innerHTML;
<dpn-blade-section is-checkbox-visible="true" is-checked="$component.showAll">
<section-title>
<h4>Show All</h4>
</section-title>