Reputation: 71
Hi i have created j hipster application with client-side framework is angular 1.x with spring boot and created two entities called Home and Customer when i create new Home entity and save it will show home entity but how can i navigate Customer page when saving my Home entity.
Upvotes: 0
Views: 386
Reputation: 3145
first, you open src/main/webapp/app/entities/home/home.controller.js
and add $router
to the controllers injection block
(function() {
'use strict';
angular
.module('yourapp')
.controller('HomeController', HomeController);
HomeController.$inject = ['$scope','$state', /* add router here */ '$router'];
function HomeController ($scope, $state, /* add router here */ $router) {
var vm = this;
//...
and than you are able to navigate your route, by proving your targets state name to $router.go('state')
in your case: $router.go('customer')
in the save function
Upvotes: 2