0
const page = angular.element('#contact-history')
this.scrollContainer = page ? page.parent().parent().parent() : null
あなたは、コードを改善し、角度1
アンギュラ1 - 改善angular.element /複数の親()
DOMを使用して複数のparent()
を避けることができる方法
、私は選択したいoverlay-content
ID:
<div id="overlay-content" class="overlay-content container-fluid ng-scope">
<h1><span translate="" translate-values="{ section: $ctrl.overlayTitle }" class="ng-scope">My Historie</span>
<ui-view class="ng-scope">
<contact-history contact="::$resolve.contact" class="ng-scope ng-isolate-scope">
<div class="row contact-history" id="contact-history">
</div>
</my-iad-contact-history>
</ui-view>
<div ui-view="overlay" class="overlay ng-scope"></div>
</div>
どのような要素に到達しようとしていますか? – Jerinaw
@Jerinawこれが追加されました –
'this.scrollContainer = page? page.parents( 'div#overlay-content'):null'?これを試して ?あなたはjqueryが含まれていることを願っています – Rahul