I understand what he is trying to explain up to a point.
My asynchronous service is this.
factory('AsynchronousService', function( HEFactory,
$q) {
return {
asynchcall:function() {
var deferred = $q.defer();
setTimeout(function() {
// Reject based on probability
if (Math.random() > 0.7) {
deferred.reject('Rejected');
}
else deferred.resolve('Succeeded');
}, 1000);
return deferred.promise;
}
};
My functional constructor is this.
function(serviceSpec){
var thatserviceLimit = {};
/** This attribute is currently bound by AngularJS
* Af of now the corresponding setter 'setUpperLimit'
* is not called by our AngularJS code. This may be
* a limitation
*/
thatserviceLimit.upperlimit = serviceSpec.upperlimit;
thatserviceLimit.lowerlimit = serviceSpec.lowerlimit;
thatserviceLimit.getUpperLimit = function(){
return thatserviceLimit.upperlimit;
};
thatserviceLimit.getLowerLimit = function(){
return thatserviceLimit.lowerlimit;
};
//thatserviceLimit.build = function(data){
//return thatserviceLimit.lowerlimit;
//};
return thatserviceLimit;
},
The commented 'build' method is what I am trying to figure out.
Mohan
On Thursday, 12 February 2015 14:16:38 UTC+5:30, Sander Elias wrote:
>
> Hi Mohan,
>
> I think this article
> <https://medium.com/opinionated-angularjs/angular-model-objects-with-javascript-classes-2e6a067c73bc>from
>
> my friend Geert will help you a bit.
> If you still have questions after reading that, just ask!
>
> Regards
> Sander
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.