AngularJS Slip no 18 Solution

<html ng-app="teacherApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"></script>
</head>
<body ng-controller="TeacherController">
<h1>Teachers Teaching SYBBA (CA)</h1>
<div ng-repeat="teacher in teachers">
<h2>{{ teacher.name }}</h2>
<img ng-src="{{ teacher.photo }}" alt="{{ teacher.name }} Photo">
<p>{{ teacher.description }}</p>
</div>
<script>
var app = angular.module('teacherApp', []);
app.controller('TeacherController', function ($scope) {
$scope.teachers = [
{
name: 'Mrs. Hemalata Chavan',
photo: 'john-doe.jpg', // Provide the correct image path
description: 'Mrs. Hemalata Chavan is an experienced teacher in DBMS.'
},
{
name: 'Mr. Tulshiram Kmble ',
photo: 'jane-smith.jpg', // Provide the correct image path
description: 'Mr. Tulshiram Kamble is an experienced teacher in AngularJS.'
}
];
});

</script>
</body>
</html>

No comments:

Post a Comment