angularjs - Does Angular Material have predetailed textboxes (ala bootstrap alert) -
been playing around angular material, , absolutely love it. found 1 rather surprising thing, , missed page in manual, or well, many pages including one.
thought add warning text along lines of "thats not password" failed login. , bootstrap , alert box.
<div class="alert alert-danger" role="alert"> <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> <span class="sr-only">error:</span> enter valid email address </div>
however, can't find similar set angular material. yes, there dialog, , toasts, wanted simpler.
and yes write own class, feels there should predefined class it?
yes angular material has dialog, can use alert dialog, documentation here
add $mddialog controller dependency , customise below code.
$scope.showalert = function(ev) { $mddialog.show( $mddialog.alert() .parent(angular.element(document.queryselector('#popupcontainer'))) .clickoutsidetoclose(true) .title('this alert title') .textcontent('you can specify description text in here.') .arialabel('alert dialog demo') .ok('got it!') .targetevent(ev) ); };
call showalert() html
<md-button class="md-primary md-raised" ng-click="showalert($event)" flex="100" flex-gt-md="auto"> alert dialog </md-button>
Comments
Post a Comment