title: AngularJS having Trouble in $http feedback to user in template
body: <p>My snippet is working well for now. it works like if a user submit something error, he gets an error message, if he successfully submit, he gets a success message, it works nice, no issue with that.</p>
  <p>at first see my current snippet:</p>
  <pre><code>$scope.onSubmit = function () {
        $http.post('http://127.0.0.1:8000/api/v1/contact', $scope.formModel)
        .then(function(response) {
          $scope.saveSuccess = true;
          $scope.message = 'You have successfully saved your contact';
          $scope.contacts.push(response.data);
        }, function(response) {
          $scope.saveSuccess = false;
          $scope.message = 'an error occurs';
        });
    };
  </code></pre>
  <p>and here you go to see how i used this on template:
  Note: the css is bootstrap clss.</p>
  <pre><code>&lt;div class=&quot;alert&quot; ng-class=&quot;{ 'alert-success': saveSuccess, 'alert-danger': !saveSuccess }&quot;&gt;
            &lt;p&gt; {{ message }} &lt;/p&gt;
  &lt;/div&gt; 
  
  My problem is, when i visit the page, it always shows me an danger color with no message 
  </code></pre>
  <p>but it works nice when a user submit error, they get error message with danger color and if he successfully post, he gets success message with succcess color</p>
  <p><strong>Only problem is, if an error occurs or not, a success occurs or not, it always shows a danger color with no text by default, why? but when error occurs or success occurs, it works nice its way.</strong></p>
  <p>I hope you got my issue.</p>
  <p>here you go for screenshot: <a href="https://i.stack.imgur.com/Aef8V.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Aef8V.png" alt="enter image description here" /></a></p>
  <p>this is always exist but if error occurs, it works nice, here you go to see the 2nd screenshot:</p>
  <p><a href="https://i.stack.imgur.com/Qcr5v.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Qcr5v.png" alt="enter image description here" /></a></p>
  <p>I have problem with first screenshot i provided and i am not getting why its happening</p>