Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Bind Sample Data in NG Grid In AngularJS
WhatsApp
Pradeep Sahoo
May 18
2015
14.2
k
0
0
<!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
Up Next
Bind Sample Data in NG Grid In AngularJS