This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorting by {{toggles.sort.itemsSort.column}}, reverse = {{toggles.sort.itemsSort.reverse}}. | |
<br> | |
<table class="table table-striped" ng-if="items.length > 0"> | |
<thead> | |
<tr> | |
<th ng-repeat="field in getFieldsSorted(items[0])" ng-click="toggles.sort.itemsSort.column='fields.'+field.name+'.value';toggles.sort.itemsSort.reverse=!toggles.sort.itemsSort.reverse;"> | |
{{field.description}} | |
</th> | |
</tr> | |
</thead> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorting by {{toggles.sort.itemsSort.column}}, reverse = {{toggles.sort.itemsSort.reverse}}. | |
<br> | |
<table class="table table-striped" ng-if="items.length > 0"> | |
<thead> | |
<tr> | |
<th ng-repeat="field in getFieldsSorted(items[0])" ng-click="toggles.sort.itemsSort.column='fields.'+field.name+'.value';toggles.sort.itemsSort.reverse=!toggles.sort.itemsSort.reverse;"> | |
{{field.description}} | |
</th> | |
</tr> | |
</thead> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table class="table table-striped" ng-if="items.length > 0"> | |
<thead> | |
<tr> | |
<th ng-repeat="field in getFieldsSorted(items[0])"> | |
{{field.description}} | |
</th> | |
</tr> | |
</thead> | |
<tbody> | |
<tr ng-repeat="i in items"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table class="table table-striped" ng-if="items.length > 0"> | |
<thead> | |
<tr> | |
<th ng-repeat="field in getFieldsSorted(items[0])"> | |
{{field.description}} | |
</th> | |
</tr> | |
</thead> | |
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//ordered fields for a single item, uses later in sorting table columns | |
[ | |
{ | |
"description": "Link", | |
"name": "link", | |
"order": 1, | |
"value": "http://www.google.com" | |
}, | |
{ | |
"description": "Name", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getFieldsSorted(item){ | |
var fields = _.sortBy(item.fields,'order'); //using the awesome underscorejs library | |
return fields; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"fields": { | |
"link": { | |
"description": "Link", | |
"name": "link", | |
"order": 1, | |
"value": "http://www.google.com" | |
}, | |
"name": { | |
"description": "Name", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.20/angular.min.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//angular.module('yourappmodule',['idleworx-message-service']); //don't forget to add a dependency to your apps's module | |
angular.module('idleworx-message-service') | |
.factory('MessageService',['$log',function ($log) { | |
$log.info('MessageService Initialized ...'); | |
var service = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div data-ng-controller="ControllerDemo"> | |
<div data-ng-if="messages" data-ng-include="'partials/messages.tpl.html'"></div> | |
<div data-ng-if="messages" data-ng-include="'partials/debug-messages.tpl.html'"></div> | |
</div> |
NewerOlder