Header Ads Widget

BCA Information

Angular js practical

 1Angular js slip

<!DOCTYPE html>

<html>

<head>

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>

<script>

var app = angular.module("myApp", []);

app.controller('userCtrl', ['$scope', function ($scope) {

$scope.showGames = function () {

$scope.games = [

{ GameName: 'Cricket', PlayerName: 'sachin', GameType: 'outdoor' },

{ GameName: 'Chess', PlayerName: 'V.Anand', GameType: 'Indoor' },

{ GameName: 'Tennis', PlayerName: 'Pet Sampras', GameType: 'outdoor' }];

}

}]);

</script>

</head>

<body ng-app="myApp" ng-controller="userCtrl">

<form>

<div ng-app="myApp" ng-init="Text='Displaying Games array Elements!'">

<p ng-bind="Text"></p>

</div>

<div ng-controller="userCtrl">

<div ng-repeat='game in games'>

{{game.GameName}}

{{game.PlayerName}}

{{game.GameType}}

</div>

</div>

<input type="button" ng-click="showGames()" value="Click Here"> </button>

</form>

</body>

</html> 



<!DOCTYPE html>

<html>

<head>

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<script>
var app = angular.module("myApp", []);
app.controller('userCtrl', ['$scope', function ($scope) {
$scope.showCourses = function () {

{ id: 'i', courseName: 'BBA(CA)' },
{ id: 'ii', courseName: 'BCA(Science' },
{ id: 'iii', courseName: 'B.Sc(Computer Science' },
];
$scope.pgcourses = [
{ id: 'i', courseName: 'M.Sc(Computer Science' },
{ id: 'ii', courseName: 'M.Sc.(CA)' },
{ id: 'iii', courseName: 'MCA' },
];
}
}]);
</script>
</head>
<body ng-app="myApp" ng-controller="userCtrl">
<form>
<div ng-controller="userCtrl">
UnderGraduate Courses<br>
<div ng-repeat='x in ugcourse'>
{{x.id}}
{{x.courseName}}
</div>
Post Graduate Courses
<div ng-repeat='x in pgcourses'>
{{x.id}}
{{x.courseName}}
</div>
</div>
<input type="button" ng-click="showCourses()" value="Click Here"> </button>
</form>
</body>
</html>

Post a Comment

0 Comments

Popular Posts

Visual Basic 6.0 Program
Node js practical