Angularjs $scope变量正在复制,未在Kendo UI窗口中引用
有一种情况是,我将$scope变量传递到剑道UI窗口中,并且正在进行任何更改 所有这些都位于一个控制器中 所以在我的主控制器中,我有一个$scope.searchTerm变量,我初始化它以“输入搜索项” 在我的HTML中,我在主控制器上调用peopleSearch.open(),如下所示Angularjs $scope变量正在复制,未在Kendo UI窗口中引用,angularjs,kendo-ui,Angularjs,Kendo Ui,有一种情况是,我将$scope变量传递到剑道UI窗口中,并且正在进行任何更改 所有这些都位于一个控制器中 所以在我的主控制器中,我有一个$scope.searchTerm变量,我初始化它以“输入搜索项” 在我的HTML中,我在主控制器上调用peopleSearch.open(),如下所示 <td><span>GSP</span><span ng-click="peopleSearch.open()" style="font-size:8pt;" clas
<td><span>GSP</span><span ng-click="peopleSearch.open()" style="font-size:8pt;" class="glyphicon glyphicon-plus-sign"></span><td>
作为参数传入的$scope.searchTerm是初始的“Enter Search Term”…而不是输入到输入字段中的值…该字段绑定到$scope.searchTerm…就好像它从一个副本开始,然后决定分离自身一样。尝试将searchcontent作为字符串的对象插入$scope.searchTerm={value:'}并使用输入ng模型作为searchTerm.Value正在尝试,谢谢。因此,我不能使用字符串变量进行双向绑定并将其作为函数参数传递?顺便说一下;-),只需要理解为什么我不能在作用域上传递字符串变量。请阅读本文以了解Hi,谢谢,尽管据我所知,我没有使用子作用域,但所有这些都发生在同一个控制器中?
<div kendo-window="peopleSearch" k-title="'Person Search'"
k-width="900" k-height="500" k-visible="false"
k-content="{ url: 'parts/peopleSearch.html' }"
k-on-open="peopleSearchVisible = true" k-on-close="peopleSearchVisible = false"
k-modal="true"></div>
<section>
<div class="myAlerts">
<alert ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)" >{{alert.msg}}</alert>
</div>
<div>People Search</div><br/>
<div>{{searchTerm}}</div>
<input type="text" ng-model="searchTerm" style="width:400px;"</input><span> Enter surname or part of surname to search the Active Directory</span>
<br/><br/>
<button ng-click="performSearch()" class="form-control" style="width:400px;">Search</button>
<br/>
<br/>
<div>
<div>{{searchTerm}}</div>
<table class="table table-bordered table-condensed" style="cell-padding:0px;cell-spaing:0px;font-size:10pt;">
<thead>
<tr>
<th>Name</th>
<th>Initials</th>
<th>Title</th>
<td>Office</td>
<th>Email</th>
<th>Company</th>
<th>Department</th>
<th>Telephone</th>
<th>Mobile</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="people in peopleResults">
<td>{{people.displayName[0]}}</td>
<td>{{people.initials[0]}}</td>
<td>{{people.title[0]}}</td>
<td>{{people.physicalDeliveryOfficeName[0]}}</td>
<td>{{people.mail[0]}}</td>
<td>{{people.company[0]}}</td>
<td>{{people.department[0]}}</td>
<td>{{people.telephoneNumber[0]}}</td>
<td>{{people.mobile[0]}}</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</section>
$scope.performSearch = function()
{
prPeopleService.findPeople($scope.searchTerm).then(function(people) {
$scope.peopleResults = people;
$scope.addAlert('success', $scope.peopleResults.length + ' people located');
},
function(response) {
$scope.addAlert('danger', 'There was an issue trying to look people up from the Active Directory...');
});
};