I am new to Angular JS and try to view student details by passing student id using routing
I have coded a bit but not geeting where to add the details of students and how to pass student id
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'; }) I want to add student details in via form but dont dont know how to add those values in controller
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.