This really help me understand how promise works. Thanks again!
And now that I can use SharedData.then(function(service) how is it possible
to play with it within a directive?
Following seems not working
app.directive('getLayout', function(SharedData) {
var buildUrl= '';
SharedData.then(function(service) {
buildUrl = '../../' + service.template + '/layouts/home.html';
console.log(buildUrl); // return ../../template1/layouts/home.html
});
return {
restrict: 'A',
link: function(scope, element, attrs) {
if (window.location.href.indexOf("?Admin") > -1) {
$('.editable').attr('contenteditable','true');
};
},
templateUrl: buildUrl
}
});
--
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.