in the view I have:
<div ng-controller="formCtrl">
<div class="alert alert-success" ng-show={{alert}}>"hey"</div>
</div>
my form:
<form name="myForm" ng-controller="formCtrl" ng-submit="submit()">...
on my controller, formCtrl, I have:
$scope.submit = function($scope) {
$http.post('/add', {brand: this.brand} ).success(function(data){
this.alert = true;
});
//this.alert(true); <-- also tried, did not work
};
I want to be able to update the alert box when the form is submitted.
So: click alert button on form then: form is submitted then: "alert" gets updated with either success or failure message
I think I the scopes all mixed up. Not sure.