<div ng-controller="SearchResultsTextCtrl" class="search-text search-results">
<div class="title" ng-if="showSearchResultsText && !showNoResultsMsg">
<div id="searchKeyword" class="main">{{searchKeyword}}</div>
<div class="num">Your search for <span style="font-style: italic">"{{searchKeyword}}"</span> returned <span id="searchResultCount">{{totalResults}}</span> {{searchResultsText}}</div>
</div>
<div class="no-results" ng-if="showNoResultsMsg">
<div class="title">SORRY NO RESULTS FOUND</div>
<p>Please try again</p>
</div>
</div>
</div>
각도가 너무 익어서 누군가가 #searchKeyword dom에서 검색 결과를 얻는 방법에 대한 올바른 방향을 가르쳐 줄 수 있습니다. 매번 jquery ('# searchkeyword')를 통해 문서를 가져옵니다. html() margret river 대신 {{searchKeyword}}의 각도 변수를 얻습니다. 당신이Angularjs 변수 출력 검색
을
$ scope.searchKeyword를 사용하거나이 요소
<div id="searchKeyword" ng-model="ngModel "class="main">{{searchKeyword}}</div>
그리고 컨트롤러에 다른 모델 이름을 추가 사용할 수에 대한
당신은 범위 내에서 변수에 액세스 할 수 있어야합니다. 예 : '$ scope.searchKeyword' – Raghavendra
Adobe의 동적 태그 관리를 사용하여 검색된 단어를 검색하기 때문에 원시 코드에 액세스 할 수없고 div에 모델을 추가 할 수 없습니다. 그래서이 시점에서 div 값에 액세스 할 수있는 유일한 방법은 $ ('# searchKeyword')입니다. html()하지만 항상 {{searchKeyword}}를 반환합니다 – user1251598
피들 또는 플 런커를 제공합니까? – Raghavendra