Im using the following code which is working OK.
Now I need to return promise resolve but not sure how to do it in this case, there is nice way to do it? please ignore that the code is sync we are working on a tool which every external API method should return promise
This is the code
getExtendedFileContent: function(sHTML, aConfig) {
var oDeferred = Q.defer();
return aConfig ? this._process(sHTML, aConfig) : sHTML;
},
the this._process(sHTML, aConfig)
& the sHTML
should return
oDeferred.promise;