TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Bind Sample Data in NG Grid In AngularJS
Pradeep Sahoo
May 18
2015
Code
14
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
<!doctype html>
<html ng-app=
"ngGridApp"
>
<head>
<title>Binding Data to NG Grid </title>
<link rel=
"stylesheet"
type=
"text/css"
href=
"http://angular-ui.github.com/ng-grid/css/ng-grid.css"
/>
<script src=
"https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"
></script>
<script src=
"//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.1/angular.min.js"
></script>
<script type=
"text/javascript"
src=
"http://angular-ui.github.com/ng-grid/lib/ng-grid.debug.js"
></script>
<style>
.ngGridStyle {
border: 2px solid gray;
width: 600px;
height: 220px;
}
</style>
<script>
var
app = angular.module(
'ngGridApp'
, [
'ngGrid'
]);
//Injected ng Grid
app.controller(
'ngGridController'
,
function
($scope) {
$scope.Data = [
{ Name:
"Anil"
, City:
"Bangalore"
, Skill:
' ASP.NET'
},
{ Name:
"Umesh"
, City:
"CHENAI"
, Skill:
'ANGULAR JS, ASP'
},
{ Name:
"Pradeep"
, City:
"Bangalore"
, Skill:
'SQL Server'
},
{ Name:
"Kumar"
, City:
"Delhi"
, Skill:
' ASP.NET'
}];
$scope.ngGridView = { data:
'Data'
};
//Assigned to Data to ng grid
});
</script>
</head>
<body ng-controller=
"ngGridController"
>
<div
class
=
"ngGridStyle"
ng-grid=
"ngGridView"
></div>
</body>
</html>
Ng Grid Data Binding
Showing Data in Grid in Angular JS