Custom Bootstrap UI alert with AngularJS -
i using angular-ui-bootstrap
lib in application. need create custom alert button inside firing modal window.
i have tried 2 options:
- redefine module
angular.module("template/alert/alert.html", [])
ui-bootstrap-tpls.js
. didn't work didn't manage implement button firing popup window. - create custom module based on
"template/alert/alert.html"
one. found myself lost in number of controllers in order make popup window working.
what best approach achieve that?
if understood question, want add button alert launch modal.
plunker demo
the easiest approach add button alert template. in plunker demo, copied both contents of ui bootstrap alert , modal demos. copied alert template , added script tag on page. inside standard alert template added button follows:
<button ng-controller="modaldemoctrl" class="btn" ng-class="'btn-' + (type || 'warning')" ng-click="open()">open modal</button>
that's incredibly basic approach, should starting point you. if doing in production, add custom templates template cache instead of using script tags on page , create custom directive modal button pass relevant information alert modal instance , away having hard code ng-controller on button itself.
Comments
Post a Comment