need help while displaying json conect. When i press a username i need to display that particular user details in a modal or a table . any suggestions on how to do that using onclick ?
var mainApp= angular.module("mainApp", []);
mainApp.controller('TableFilterController', function($scope) {
$scope.clickMe = function(p) {
$scope.selected = p;
}
$scope.isSelected = function(p) {
return $scope.selected === p;
}
$scope.details = [
{
name : 'Mercury',
age : 0.4,
mass : 0.055,
descp : 'it is the hottest planet',
},
You can popup a dilaog box using a $modal
of bootstrap,
$modal.open({
templateUrl: 'myModalContent.html',
backdrop: true,
windowClass: 'modal',
controller: function($scope, $modalInstance, $log) {
$scope.selected = p;
$scope.submit = function() {
$log.log('Submiting user info.');
$log.log($scope.selected);
$modalInstance.dismiss('cancel');
}
$scope.cancel = function() {
$modalInstance.dismiss('cancel');
};
},
resolve: {
user: function() {
return $scope.selected;
}
}
});