Я новичок в Angular JS и пытаюсь просмотреть сведения об учащемся, передавая идентификатор учащегося с помощью маршрутизации
Я немного кодировал, но не знаю, куда добавить сведения об учащемся и как передать идентификатор учащегося
this is the code for index.html
<div>
<div>
<div>
<ul>
<li><a href="#add"> Add Student </a></li>
<li><a href="#show"> Show Student </a></li>
</ul>
</div>
<div >
<div ng-view></div>
</div>
</div>
</div>
this is the code for app.js
```````````````````````````````````````````
var myApp = angular.module('stuApp', []);
myApp.config(['$routeProvider',
function ($routeProvider) {
$routeProvider.
when('/add', {
templateUrl: 'add_student.html',
controller: 'addCtrl'
}).
when('/show', {
templateUrl: 'show_student.html',
controller: 'showCtrl'
}).
otherwise({
redirectTo: '/add'
});
}]);
myApp.controller('addCtrl', function ($scope) {
$scope.message = 'This is Add new Student screen';
});
myApp.controller('showCtrl', function ($scope) {
$scope.message = 'This is Show Student screen';
})
Я хочу добавить данные ученика через форму, но не знаю, как добавить эти значения в контроллер
add_student.html
````````````````````````````
<script type="text/ng-template" id="add_student.html">
<h2>Add New Student</h2>
{{ message }}
</script>
show_student.html
<script type="text/ng-template" id="show_student.html">
<h2>Show Order</h2>
{{ message }}
</script>
I want the output as to pass object in controller display the students name and by clicking on the name student details should be displayed.