I\'m making a directive that takes a function as a scope parameter (scope: { method:\'&theFunction\' }). I need to know if the result returned by that metho
scope: { method:\'&theFunction\' }
Angular's when() is a good option as Davin mentioned.
when()
If that doesn't meet your needs then Angular's internal way of checking (it uses this inside when) is very close to what you're doing:
when
var ref = function(value) { if (value && isFunction(value.then)) { // Then this is promise }