Here is example http://jsfiddle.net/FredyC/3pynD/2/ although not fully functional yet, i am not sure how to use jsfiddle echo service correctly with jQuery.
However point is, that when i run this, than dfd object doesn’t have the resolve function. My goal is to have function, that will always return promise object where i can through done function get compiled template. When i want that template again later, it should return same dfd so i get template right away without fetching and compiling it again.
Does anybody know what i am doing wrong ?
Ok, it’s solved. After rereading documentation i had understand that
$.whenis returning justpromise, so i cannotresolveit. So i created newDeferredobject and it works like a magic 🙂Here is the result: http://jsfiddle.net/FredyC/3pynD/3/