如何为bellow控制器编写单元测试用例。我对angularjs完全陌生,我必须解决这个问题。请引导我
angular.module('ourAppApp')
.controller('MainCtrl', function($scope,apiFac) {
$scope.displayCity = false;
$scope.displayWeather = false;
$scope.today = new Date();
$scope.searchCity = function(){
if($scope.cityInput != ""){
apiFac.searchCity($scope.cityInput).then(function(response){
$scope.searchResponse = response;
$scope.displayCity = true;
})
}
}
$scope.getcitydetails = function(item){
$scope.cityInput = "";
$scope.displayCity = false;
$scope.selectedCity = item;
apiFac.weatherReport(item.woeid).then(function(response){
$scope.weatherResponse = response;
$scope.displayCity = false;
$scope.displayWeather = true;
})
}
})
暂无答案!
目前还没有任何答案,快来回答吧!