Skip to main content
edited body
Source Link
Michael G
  • 6.8k
  • 2
  • 45
  • 60

Check out the redirectTo state definition property.

From the ui-router documentation:

Synchronously or asynchronously redirects Transitions to a different state/params

If this property is defined, a Transition directly to this state will be redirected based on the property's value.

https://ui-router.github.io/ng1/docs/latest/interfaces/state.statedeclaration.html#redirectto

Example:

state.state('root', {
      url: "/",
      redirectTo: "shop"  
})

Full working example: here.

If you want any unknown route to redirect to /shop, you could use the following:

$urlRouterProvider.otherwise('/shop');

Check out the redirectTo state definition property.

From the ui-router documentation:

Synchronously or asynchronously redirects Transitions to a different state/params

If this property is defined, a Transition directly to this state will be redirected based on the property's value.

https://ui-router.github.io/ng1/docs/latest/interfaces/state.statedeclaration.html#redirectto

Example:

state.('root', {
      url: "/",
      redirectTo: "shop"  
})

Full working example: here.

If you want any unknown route to redirect to /shop, you could use the following:

$urlRouterProvider.otherwise('/shop');

Check out the redirectTo state definition property.

From the ui-router documentation:

Synchronously or asynchronously redirects Transitions to a different state/params

If this property is defined, a Transition directly to this state will be redirected based on the property's value.

https://ui-router.github.io/ng1/docs/latest/interfaces/state.statedeclaration.html#redirectto

Example:

.state('root', {
      url: "/",
      redirectTo: "shop"  
})

Full working example: here.

If you want any unknown route to redirect to /shop, you could use the following:

$urlRouterProvider.otherwise('/shop');
added 1 character in body
Source Link
Michael G
  • 6.8k
  • 2
  • 45
  • 60

Check out the redirectTo state definition property.

From the ui-router documentation:

Synchronously or asynchronously redirects Transitions to a different state/params

If this property is defined, a Transition directly to this state will be redirected based on the property's value.

https://ui-router.github.io/ng1/docs/latest/interfaces/state.statedeclaration.html#redirectto

Example:

state.('root', {
      url: """/",
      redirectTo: "shop"  
})

Full working example: here.

If you want any unknown route to redirect to /shop, you could use the following:

$urlRouterProvider.otherwise('/shop');

Check out the redirectTo state definition property.

From the ui-router documentation:

Synchronously or asynchronously redirects Transitions to a different state/params

If this property is defined, a Transition directly to this state will be redirected based on the property's value.

https://ui-router.github.io/ng1/docs/latest/interfaces/state.statedeclaration.html#redirectto

Example:

state.('root', {
      url: "",
      redirectTo: "shop"  
})

Full working example: here.

If you want any unknown route to redirect to /shop, you could use the following:

$urlRouterProvider.otherwise('/shop');

Check out the redirectTo state definition property.

From the ui-router documentation:

Synchronously or asynchronously redirects Transitions to a different state/params

If this property is defined, a Transition directly to this state will be redirected based on the property's value.

https://ui-router.github.io/ng1/docs/latest/interfaces/state.statedeclaration.html#redirectto

Example:

state.('root', {
      url: "/",
      redirectTo: "shop"  
})

Full working example: here.

If you want any unknown route to redirect to /shop, you could use the following:

$urlRouterProvider.otherwise('/shop');
added 160 characters in body
Source Link
Michael G
  • 6.8k
  • 2
  • 45
  • 60

Check out the redirectTo state definition property.

From the ui-router documentation:

Synchronously or asynchronously redirects Transitions to a different state/params

If this property is defined, a Transition directly to this state will be redirected based on the property's value.

https://ui-router.github.io/ng1/docs/latest/interfaces/state.statedeclaration.html#redirectto

Example:

state.('root', {
      url: "/""",
      redirectTo: "shop"  
})

Full working example: here.

If you want any unknown route to redirect to /shop, you could use the following:

$urlRouterProvider.otherwise('/shop');

Check out the redirectTo state definition property.

From the ui-router documentation:

Synchronously or asynchronously redirects Transitions to a different state/params

If this property is defined, a Transition directly to this state will be redirected based on the property's value.

https://ui-router.github.io/ng1/docs/latest/interfaces/state.statedeclaration.html#redirectto

Example:

state.('root', {
      url: "/",
      redirectTo: "shop"  
})

Check out the redirectTo state definition property.

From the ui-router documentation:

Synchronously or asynchronously redirects Transitions to a different state/params

If this property is defined, a Transition directly to this state will be redirected based on the property's value.

https://ui-router.github.io/ng1/docs/latest/interfaces/state.statedeclaration.html#redirectto

Example:

state.('root', {
      url: "",
      redirectTo: "shop"  
})

Full working example: here.

If you want any unknown route to redirect to /shop, you could use the following:

$urlRouterProvider.otherwise('/shop');
Source Link
Michael G
  • 6.8k
  • 2
  • 45
  • 60
Loading