can-route
Advanced tools
Comparing version 4.1.1 to 4.1.2
@@ -82,28 +82,27 @@ @module {Object} can-route can-route | ||
import route from "can-route"; | ||
import DefineMap from "can-define/map/map"; | ||
import stache from "can-stache"; | ||
import "can-stache-route-helpers"; | ||
Component.extend( { | ||
tag: "my-app", | ||
autoMount: true, | ||
ViewModel: DefineMap.extend( { | ||
page: "string" | ||
} ), | ||
view: stache( ` | ||
{{#switch(page)}} | ||
{{#case("home")}} | ||
<h1>Home Page</h1> | ||
<a href="{{#routeUrl(page='products')}}">Products</a> | ||
{{/case}} | ||
{{#case("products")}} | ||
<h1>Products</h1> | ||
<a href="{{#routeUrl(page='home')}}">Home</a> | ||
{{/case}} | ||
{{#default()}} | ||
<h1>Page Not Found</h1> | ||
<a href="{{#routeUrl(page='home')}}">Home</a> | ||
{{/default}} | ||
{{/switch}} | ||
` ) | ||
} ); | ||
Component.extend({ | ||
tag: "my-app", | ||
ViewModel: { | ||
page: "string" | ||
}, | ||
view: ` | ||
{{#switch(page)}} | ||
{{#case("home")}} | ||
<h1>Home Page</h1> | ||
<a href="{{#routeUrl(page='products')}}">Products</a> | ||
{{/case}} | ||
{{#case("products")}} | ||
<h1>Products</h1> | ||
<a href="{{#routeUrl(page='home')}}">Home</a> | ||
{{/case}} | ||
{{#default()}} | ||
<h1>Page Not Found</h1> | ||
<a href="{{#routeUrl(page='home')}}">Home</a> | ||
{{/default}} | ||
{{/switch}} | ||
` | ||
}); | ||
route.data = document.querySelector( "my-app" ); | ||
@@ -110,0 +109,0 @@ route.register( "{page}" ); |
{ | ||
"name": "can-route", | ||
"version": "4.1.1", | ||
"version": "4.1.2", | ||
"description": "Observable front-end application routing for CanJS.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://canjs.com/doc/can-route.html", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
106654
0