Skip to content

Instantly share code, notes, and snippets.

@alejandroiglesias
Last active December 21, 2015 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alejandroiglesias/6358435 to your computer and use it in GitHub Desktop.
Save alejandroiglesias/6358435 to your computer and use it in GitHub Desktop.
app.factory('notification', function ($document, $templateCache, $compile) {
return {
show: function (message) {
// Compile template.
var template = $templateCache.get('template/notification.html');
console.log('tpl', $compile(template)); // This breaks
// Append notifications to DOM element.
// $document.find('#notifications').append(el);
}
};
});
<script id="template/notification.html" type="text/ng-template">
<div class="friends-invited-popup">
<div class="tooltip-info">
<div class="kenny">
<img src="{% static 'images/tooltip-info-kenny.png' %}">
</div>
<div class="content">
<div class="txt">{{message}}</div>
</div>
</div>
</div>
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment