I tried using Angular with Bluebird promises:
HTML:
<body ng-app="HelloApp">
<div ng-controller="HomeController">{{name}} {{also}}</div>
</body>
JS:
// javascript
var app = angular.module('HelloApp', []);
app.controller("HomeController", function ($scope) {
var p = Promise.delay(1000).then(function () {
$scope.name = "Bluebird!";
console.log("Here!", $scope.name);
}).then(function () {
$scope.also = "Promises";
});
$scope.name = "$q";
$scope.also = "promises";
});
window.app = app;
[Fiddle]
However, no matter what I tried, it kept staying "$q promises"
and did not update. Except if I added a manual $scope.$apply
which I'd rather avoid.
How do I get Bluebird to work with AngularJS?
(I know it's possible since $q does it)
I'm using Bluebird 2.0 which I got here.