Hi I am developing Angularjs application. I am new to Angularjs. I am facing some issues in Nesting of UI states. My requirement is to develop forgot password page. Flow will be as below.
ForGotPassword
Step 1: MobileNumber
DOB
Submit->If successful then
Step 2: OTP
Verify->If successful then
Step 3: New Password
Confirm Password
Submit.
For the above three steps I want to inject the respective pages in
class="container">
<div ui-view></div>
</div>
This is my main controller.
var app = angular.module('RoslpApp', ['pascalprecht.translate', 'ui.router']);
app.config(function ($stateProvider, $urlRouterProvider, $urlRouterProvider, $translateProvider, $translatePartialLoaderProvider) {
$stateProvider.state('ForgotPassword', {
url: '/ForgotPassword',
templateUrl: 'ForgotPassword/ForgotPassword.html',
controller: 'ForgotPassword'
});
});
This is my forgotpassword controller.
(function () {
angular.module('RoslpApp').controller('ForgotPassword', ['$rootScope', '$translatePartialLoader', '$translate', function ($rootScope, $translatePartialLoader, $translate) {
$stateProvider
.state('ResetPassword', {
url: '/ResetPassword',
templateUrl: 'ForgotPassword/ResetPassword.html',
controller: 'ResetPassword'
});
$stateProvider
.state('OTPVerification', {
url: '/OTPVerification',
templateUrl: 'ForgotPassword/OTPVerification.html',
controller: 'OTPVerification'
});
$stateProvider
.state('ChangePassword', {
url: '/ChangePassword',
templateUrl: 'ForgotPassword/ChangePassword.html',
controller: 'ChangePassword'
});
}]);
})();
Forgotpassword.html
<div class="container">
<div ui-view></div>
</div>
Also i have ResetPassword.html,OTPVerification.html,ChangePassword.html with respective text boxes. I am not sure I am doing it correctly or not? May I get some help here. Any help would be appreciated. Thank you.