我试图使用ng类设置tr的类,其值为ng-重复。我在网上看到的所有例子似乎都调用了一个函数。我可以用值来设置ng类,而不是使用函数吗?
这些都不管用。
<tr ng-class="{{res.resopnse.label}}" ng-repeat="res in responses">
<tr ng-class="res.resopnse.label" ng-repeat="res in responses">
<tr ng-class="{res.resopnse.label}" n
在下面的步骤中,我遇到了麻烦:
将数据发布到rest服务器,并得到完整的记录作为回报。
使用新记录更新网页。
我有一个工作的$resource,并使用以下方法在控制器中发布我的帖子。
$scope.update = function(newRecord) {
//use resource called apiClient to POST a record to API server
apiClient.save(newRecord).$promise.then(function(response) {
//attempt
我有一个ng-重复使用ng-开关来分隔ng-重复,我想在ng-开关组上应用一个orderby过滤器,但是我似乎无法使它工作:
<div ng-controller="MyCtrl">
I have {{friends.length}} friends. They are:
<ul>
<li ng-repeat="friend in sortedFriends">
<ng-switch on="$first || friend.age != sortedFri