Show loading option in angularjs while fetching content using $http -
i creating directive have reusable way show option labeled 'loading...' in select tag. problematic comes because i'd notified specified connection (as shown in fiddle) , because i'd directive know nothing model ($scope).
the fiddle @ http://jsfiddle.net/5uhbn/8/ code, i'll show i'm trying @ moment. following handler called @ start of connection:
var startrequesthandler = function() { ngmodelctrl.$setviewvalue(obj); selectctrl.addoption(msg); /** * above i'd want angular adding element combo. **/ console.log('started endrequesthandler'); };
the next handler called when connection done , resets value:
var endrequesthandler = function() { selectctrl.removeoption(msg); ngmodelctrl.$setviewvalue(null); /** * above i'd want angular removing element combo. **/ console.log('ended endrequesthandler'); };
thank you!
Comments
Post a Comment