Properly reset add field when canceling
parent
c6f3df8df2
commit
4f810ec04a
|
@ -246,6 +246,7 @@ app.controller('WeatherController', ['$scope', '$interval', '$timeout', '$compil
|
|||
if (r.data != null && !undef(r.data['id'])) {
|
||||
$scope.cities.push({"name": city.name, "id": r.data['id']})
|
||||
$scope.showAddCity = false;
|
||||
city.name = "";
|
||||
}
|
||||
else {
|
||||
$scope.addCityError = 'Failed to add city. Please contact your administrator';
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<div class="icon-delete svn delete action" ng-click="deleteCity(city);"></div>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" ng-click="showAddCity = true;">Add a city...</a>
|
||||
<a href="#" ng-click="city.name = ''; addCityError = ''; showAddCity = true;">Add a city...</a>
|
||||
<div ng-show="showAddCity == true" id="create-city">
|
||||
<h1>Add city</h1>
|
||||
<hr>
|
||||
|
|
Loading…
Reference in New Issue