JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://code.angularjs.org/angular-1.0.0rc3.min.js"></script>
<div ng-app>
<div ng-controller="MyController">
<button ng-click="test()">Test with ErrBack</button>
<button ng-click="test2()">Test without ErrBack</button>
<pre>{{message}}<pre>
</div>
</div>
JavaScript
function MyController($scope, $q) {
var willRejectPromise = function() {
return $q.reject('Rejected');
};
$scope.test = function() {
willRejectPromise().then(
function() {
$scope.message = "Fulfilled";
},
function() {
$scope.message = "Rejected";
});
};
$scope.test2 = function() {
willRejectPromise().then(
function() {
$scope.message = "Fulfilled";
});
};
}