0

以下是我的代码..一旦我更新 $scope 变量,即使在检查 DOM 时模型也会按预期更改,但视图不会更新。我已经尽一切努力让我的观点出现,但没有运气。请协助。

编码

//Initialize our Angular Application
var app = angular.module("myApp",[]);
app.controller("inputController",function($scope,$http,$interval){
	
	$scope.views ={
		login_screen : false,
		search_screen : false,
		picture_screen : false,
		txloss_screen : false,
		emptloaded_screen : false,
		kd_screen : false,
		tat_screen : false,
		info_screen : false
	};



	

	//show correct view
	$scope.showView = function(view){
		$scope.views[view] = true;
	}
<div class="container-fluid mainWrapper" ng-controller="inputController">
  
  ...
  <li><a href="#"  ng-click="showView('search_screen')">Search</a></li>
  
  ...
  
  <div class = 'row search_screen' ng-show="{{views.search_screen}}">
  ...
  </div>
  
  
</div>

4

1 回答 1

0

ngShow不需要{{}}- 它已经需要一个 Angular 表达式:

ng-show="views.search_screen"
于 2015-09-02T14:36:25.853 回答