alexcrack / angular-ui-notification

Angular.js service providing simple notifications using Bootstrap 3 styles with css transitions for animating
MIT License
536 stars 169 forks source link

No custom template in version 0.0.12 #37

Closed pawlowskim closed 8 years ago

pawlowskim commented 8 years ago

Hello

First of all, I want to tell you I'm appreciate for your job this plugin works like a charm :)

Actually it worked like a charm until new release. Since 0.0.12 my custom templates aren't loaded. Everything works fine on 0.0.11.

Here is my code for debug purpose (template and call to notification):

<div class="ui-notification" custom-template>
    <h3>{{ msgTitle }}</h3>
    <div class="message">
        {{ msgBody }}<br>
        <a data-ng-show="someValue" href="a_link">Show Details</a>
        <a data-ng-show="!someValue" href="a_link">Show Details</a>
    </div>
</div>

var scope = $rootScope.$new(false);
scope.msgTitle = msg.notification.title;
scope.msgBody = msg.notification.body;
Notification.success({
    delay: 5000,
    template: "views/app/common/notification/template.html",
    scope: scope,
    replaceMessage: true
});
alexcrack commented 8 years ago

Hello. Sorry for your trouble. The 'template' parameter has been replaced by 'templateUrl'. So, you have to change 'template' to 'templateUrl' to make you code works. Documentation also has been updated.

var scope = $rootScope.$new(false);
scope.msgTitle = msg.notification.title;
scope.msgBody = msg.notification.body;
Notification.success({
    delay: 5000,
    templateUrl: "views/app/common/notification/template.html",
    scope: scope,
    replaceMessage: true
})

I think 'templateUrl' name is more clear.

pawlowskim commented 8 years ago

Thanks for the fast respone.