Skip to content

Instantly share code, notes, and snippets.

View idleworx's full-sized avatar

idleworx

View GitHub Profile
@idleworx
idleworx / gist:2ac5e096dcf11522b493
Created August 20, 2014 03:39
AngularJS MessageService debug-messages.tpl.html Usage Example 1
<div data-ng-if="messages.debugMessage" class="alert alert-info">
<h3>Debug</h3>
<p>{{messages.debugMessage}}</p>
<pre data-ng-if="messages.debugData"><span data-ng-bind="messages.debugData | json"></span></pre>
</div>
@idleworx
idleworx / gist:7355606a935e5de4a0fb
Created August 20, 2014 03:28
AngularJS MessageService messages.tpl.html Usage Example 1
<div data-ng-if="messages.infoMessage" class="alert alert-info">
<h3>Info</h3>
<p>{{messages.infoMessage}}</p>
</div>
<div data-ng-if="messages.warnMessage" class="alert alert-warning">
<h3>Warning</h3>
<p>{{messages.warnMessage}}</p>
</div>
@idleworx
idleworx / gist:9d75f46e01e646332bd0
Last active August 29, 2015 14:05
AngularJS MessageService Controller Usage Example 1
angular.module('idleworx-message-service')
.controller('ControllerDemo',['$scope','MessageService',function($scope,MessageService){
MessageService.init($scope); //1st thing inside a controller, call the init() method
/*
Then anywhere inside your controller you need to write a message use the message service methods.
Don't forget to pass in the current scope.
*/