Skip to content

Instantly share code, notes, and snippets.

@joeauty
Created December 28, 2014 05:02
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save joeauty/13424d300b5ee0bca04c to your computer and use it in GitHub Desktop.
'use strict';
/**
* @ngdoc function
* @name datasprocketApp.controller:MainCtrl
* @description
* # MainCtrl
* Controller of the datasprocketApp
*/
angular.module('datasprocketApp')
.config(['LoopBackResourceProvider', function(LoopBackResourceProvider) {
LoopBackResourceProvider.setUrlBase('http://localhost:3000/api');
}])
.controller('EditTable', ['$scope', '$routeParams', 'Registereddb', function ($scope, $routeParams, Registereddb) {
Registereddb.get({
id: $routeParams.id
}, function (data) {
$scope.selectedtable = data;
});
// fetch data for table
Registereddb.fetchdata({
id:$routeParams.id
}, function(fetchdata) {
$scope.userdata = fetchdata.data.userdata;
$scope.schema = fetchdata.data.schema;
//console.log(fetchdata.data.schema);
});
$scope.compareField = function(thisfield, fieldtype) {
//console.log(thisfield + ' ' + fieldtype);
if (thisfield === fieldtype) { return true; }
};
}
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment