How to use the can.route.register function in can

To help you get started, we’ve selected a few can examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github donejs / place-my-order / src / app.js View on Github external
return steal.import('~/pages/restaurant/list/').then(({default: RestaurantList}) => {
					return new RestaurantList();
				});
			}

			case 'order-history': {
				return steal.import('~/pages/order/history.component').then(({default: OrderHistory}) => {
					return new OrderHistory();
				});
			}
		}
	}
});

route.urlData = new RoutePushstate();
route.register("{page}", { page: "home" });
route.register('{page}/{slug}', { slug: null });
route.register('{page}/{slug}/{action}', { slug: null, action: null });

export default AppViewModel;
github canjs / canjs / demos / technology-overview / route-mini-app.html View on Github external
default() {
                route.register("{page}", { page: "home" });
                route.register("tasks/{taskId}", { page: "tasks" });
                route.start();
                return route.data;
            }
        },
github canjs / canjs / demos / technology-overview / route-mini-app.html View on Github external
default() {
                route.register("{page}", { page: "home" });
                route.register("tasks/{taskId}", { page: "tasks" });
                route.start();
                return route.data;
            }
        },
github donejs / donejs / guides / place-my-order / steps / additional / app.js View on Github external
});
      }

      case 'order-history': {
        return steal.import('~/pages/order/history.component').then(({default: OrderHistory}) => {
          return new OrderHistory();
        });
      }
    }
  }
});

route.urlData = new RoutePushstate();
route.register("{page}", { page: "home" });
route.register('{page}/{slug}', { slug: null });
route.register('{page}/{slug}/{action}', { slug: null, action: null });

export default AppViewModel;
github donejs / donejs / guides / place-my-order / steps / create-routes / app.js View on Github external
action: 'string',
  env: {
    default: () => ({NODE_ENV:'development'})
  },
  title: {
    default: 'place-my-order'
  },
  routeData: {
    default: () => route.data
  }
});

route.urlData = new RoutePushstate();
route.register("{page}", { page: "home" });
route.register('{page}/{slug}', { slug: null });
route.register('{page}/{slug}/{action}', { slug: null, action: null });

export default AppViewModel;
github donejs / donejs / guides / place-my-order / steps / create-routes / app.js View on Github external
page: 'string',
  slug: 'string',
  action: 'string',
  env: {
    default: () => ({NODE_ENV:'development'})
  },
  title: {
    default: 'place-my-order'
  },
  routeData: {
    default: () => route.data
  }
});

route.urlData = new RoutePushstate();
route.register("{page}", { page: "home" });
route.register('{page}/{slug}', { slug: null });
route.register('{page}/{slug}/{action}', { slug: null, action: null });

export default AppViewModel;
github donejs / donejs / guides / place-my-order / steps / switch-between / app.js View on Github external
return steal.import('~/pages/restaurant/list/').then(({default: RestaurantList}) => {
          return new RestaurantList();
        });
      }

      case 'order-history': {
        return steal.import('~/pages/order/history.component').then(({default: OrderHistory}) => {
          return new OrderHistory();
        });
      }
    }
  }
});

route.urlData = new RoutePushstate();
route.register("{page}", { page: "home" });
route.register('{page}/{slug}', { slug: null });
route.register('{page}/{slug}/{action}', { slug: null, action: null });

export default AppViewModel;
github donejs / donejs / guides / place-my-order / steps / switch-between / app.js View on Github external
});
      }

      case 'order-history': {
        return steal.import('~/pages/order/history.component').then(({default: OrderHistory}) => {
          return new OrderHistory();
        });
      }
    }
  }
});

route.urlData = new RoutePushstate();
route.register("{page}", { page: "home" });
route.register('{page}/{slug}', { slug: null });
route.register('{page}/{slug}/{action}', { slug: null, action: null });

export default AppViewModel;