Skip to content

Instantly share code, notes, and snippets.

@narenaryan
Last active November 12, 2016 04:29
Show Gist options
  • Select an option

  • Save narenaryan/40d2729489e329940a8d793dab1ebcae to your computer and use it in GitHub Desktop.

Select an option

Save narenaryan/40d2729489e329940a8d793dab1ebcae to your computer and use it in GitHub Desktop.
// Angular JS code
var app = angular.module('website', [])
app.service('dataService', function() {
this.UIData = {
BorderedTable: [[
"index.html",
1266,
32.3 % ,
321.33
], [
"about.html",
261,
33.3 % ,
234.12
]],
BorderedWithStrippedTable: [[
"index.html",
1266,
32.3 % ,
321.33
], [
"about.html",
261,
33.3 % ,
234.12
]],
BasicTable: [[
"index.html",
1266,
32.3 % ,
321.33
], [
"about.html",
261,
33.3 % ,
234.12
]],
StripedRowsTable: [[
"index.html",
1266,
32.3 % ,
321.33
], [
"about.html",
261,
33.3 % ,
234.12]]
}
});
app.controller('MainController', function($scope, dataService) {
$scope.data = dataService.UIData;
$scope.addBorderedTableRow = function(data){
$scope.data.BorderedTable.push(data);
}
// Similarly define another handlers
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment