Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does the component work with a native Promise? #114

Closed
stanleyxu2005 opened this issue Jun 27, 2017 · 1 comment
Closed

Does the component work with a native Promise? #114

stanleyxu2005 opened this issue Jun 27, 2017 · 1 comment

Comments

@stanleyxu2005
Copy link

My simple does not work. I dont want to use Angular's promise.

<div cg-busy="loading">Something</div>

In my controller

$scope.loading = new Promise(function(resolve, reject) {
  setTimetout(function() {
    resolve();
  }, 3000);
));

My question is how to fix my problem?

@MarkMYoung
Copy link

It will. The code checks to see whether the first truthy property of promiseThing && (promiseThing.then || promiseThing.$then || (promiseThing.$promise && promiseThing.$promise.then is not undefined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants