aurelia-templating-router
Advanced tools
Comparing version 1.3.1 to 1.3.2
{ | ||
"name": "aurelia-templating-router", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "An implementation of the RouteLoader interface for use with the router module. Also contains a custom element that allows the templating engine to display the current route.", | ||
@@ -22,3 +22,3 @@ "keywords": [ | ||
"dependencies": { | ||
"aurelia-binding": "^1.3.0", | ||
"aurelia-binding": "^2.0.0", | ||
"aurelia-dependency-injection": "^1.0.0", | ||
@@ -30,4 +30,4 @@ "aurelia-logging": "^1.0.0", | ||
"aurelia-router": "^1.5.0", | ||
"aurelia-templating": "^1.5.0" | ||
"aurelia-templating": "^1.8.1" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
define(['exports', 'aurelia-pal', 'aurelia-router', './route-loader', './router-view', './route-href'], function (exports, _aureliaPal, _aureliaRouter, _routeLoader, _routerView, _routeHref) { | ||
define(['exports', 'aurelia-router', './route-loader', './router-view', './route-href'], function (exports, _aureliaRouter, _routeLoader, _routerView, _routeHref) { | ||
'use strict'; | ||
@@ -11,3 +11,3 @@ | ||
function configure(config) { | ||
config.singleton(_aureliaRouter.RouteLoader, _routeLoader.TemplatingRouteLoader).singleton(_aureliaRouter.Router, _aureliaRouter.AppRouter).globalResources(_aureliaPal.PLATFORM.moduleName('./router-view'), _aureliaPal.PLATFORM.moduleName('./route-href')); | ||
config.singleton(_aureliaRouter.RouteLoader, _routeLoader.TemplatingRouteLoader).singleton(_aureliaRouter.Router, _aureliaRouter.AppRouter).globalResources(_routerView.RouterView, _routeHref.RouteHref); | ||
@@ -14,0 +14,0 @@ config.container.registerAlias(_aureliaRouter.Router, _aureliaRouter.AppRouter); |
@@ -64,4 +64,2 @@ define(['exports', 'aurelia-dependency-injection', 'aurelia-templating', 'aurelia-router', 'aurelia-path', 'aurelia-metadata', './router-view'], function (exports, _aureliaDependencyInjection, _aureliaTemplating, _aureliaRouter, _aureliaPath, _aureliaMetadata, _routerView) { | ||
config = config || {}; | ||
var instruction = { | ||
@@ -68,0 +66,0 @@ viewModel: viewModel, |
@@ -253,4 +253,2 @@ import * as LogManager from 'aurelia-logging'; | ||
config = config || {}; | ||
let instruction = { | ||
@@ -257,0 +255,0 @@ viewModel: viewModel, |
@@ -8,4 +8,2 @@ 'use strict'; | ||
var _aureliaPal = require('aurelia-pal'); | ||
var _aureliaRouter = require('aurelia-router'); | ||
@@ -20,3 +18,3 @@ | ||
function configure(config) { | ||
config.singleton(_aureliaRouter.RouteLoader, _routeLoader.TemplatingRouteLoader).singleton(_aureliaRouter.Router, _aureliaRouter.AppRouter).globalResources(_aureliaPal.PLATFORM.moduleName('./router-view'), _aureliaPal.PLATFORM.moduleName('./route-href')); | ||
config.singleton(_aureliaRouter.RouteLoader, _routeLoader.TemplatingRouteLoader).singleton(_aureliaRouter.Router, _aureliaRouter.AppRouter).globalResources(_routerView.RouterView, _routeHref.RouteHref); | ||
@@ -23,0 +21,0 @@ config.container.registerAlias(_aureliaRouter.Router, _aureliaRouter.AppRouter); |
@@ -55,4 +55,2 @@ 'use strict'; | ||
config = config || {}; | ||
var instruction = { | ||
@@ -59,0 +57,0 @@ viewModel: viewModel, |
@@ -1,2 +0,1 @@ | ||
import { PLATFORM } from 'aurelia-pal'; | ||
import { Router, AppRouter, RouteLoader } from 'aurelia-router'; | ||
@@ -8,3 +7,3 @@ import { TemplatingRouteLoader } from './route-loader'; | ||
function configure(config) { | ||
config.singleton(RouteLoader, TemplatingRouteLoader).singleton(Router, AppRouter).globalResources(PLATFORM.moduleName('./router-view'), PLATFORM.moduleName('./route-href')); | ||
config.singleton(RouteLoader, TemplatingRouteLoader).singleton(Router, AppRouter).globalResources(RouterView, RouteHref); | ||
@@ -11,0 +10,0 @@ config.container.registerAlias(Router, AppRouter); |
@@ -30,4 +30,2 @@ var _dec, _class, _dec2, _class2; | ||
config = config || {}; | ||
let instruction = { | ||
@@ -34,0 +32,0 @@ viewModel: viewModel, |
@@ -1,2 +0,1 @@ | ||
import { PLATFORM } from 'aurelia-pal'; | ||
import { Router, AppRouter, RouteLoader } from 'aurelia-router'; | ||
@@ -8,3 +7,3 @@ import { TemplatingRouteLoader } from './route-loader'; | ||
function configure(config) { | ||
config.singleton(RouteLoader, TemplatingRouteLoader).singleton(Router, AppRouter).globalResources(PLATFORM.moduleName('./router-view'), PLATFORM.moduleName('./route-href')); | ||
config.singleton(RouteLoader, TemplatingRouteLoader).singleton(Router, AppRouter).globalResources(RouterView, RouteHref); | ||
@@ -11,0 +10,0 @@ config.container.registerAlias(Router, AppRouter); |
@@ -44,4 +44,2 @@ var _dec, _class, _dec2, _class2; | ||
config = config || {}; | ||
var instruction = { | ||
@@ -48,0 +46,0 @@ viewModel: viewModel, |
'use strict'; | ||
System.register(['aurelia-pal', 'aurelia-router', './route-loader', './router-view', './route-href'], function (_export, _context) { | ||
System.register(['aurelia-router', './route-loader', './router-view', './route-href'], function (_export, _context) { | ||
"use strict"; | ||
var PLATFORM, Router, AppRouter, RouteLoader, TemplatingRouteLoader, RouterView, RouteHref; | ||
var Router, AppRouter, RouteLoader, TemplatingRouteLoader, RouterView, RouteHref; | ||
function configure(config) { | ||
config.singleton(RouteLoader, TemplatingRouteLoader).singleton(Router, AppRouter).globalResources(PLATFORM.moduleName('./router-view'), PLATFORM.moduleName('./route-href')); | ||
config.singleton(RouteLoader, TemplatingRouteLoader).singleton(Router, AppRouter).globalResources(RouterView, RouteHref); | ||
@@ -16,5 +16,3 @@ config.container.registerAlias(Router, AppRouter); | ||
return { | ||
setters: [function (_aureliaPal) { | ||
PLATFORM = _aureliaPal.PLATFORM; | ||
}, function (_aureliaRouter) { | ||
setters: [function (_aureliaRouter) { | ||
Router = _aureliaRouter.Router; | ||
@@ -21,0 +19,0 @@ AppRouter = _aureliaRouter.AppRouter; |
@@ -101,4 +101,2 @@ 'use strict'; | ||
config = config || {}; | ||
var instruction = { | ||
@@ -105,0 +103,0 @@ viewModel: viewModel, |
@@ -333,4 +333,2 @@ 'use strict'; | ||
config = config || {}; | ||
var instruction = { | ||
@@ -337,0 +335,0 @@ viewModel: viewModel, |
@@ -1,1 +0,1 @@ | ||
{"name":"aurelia-templating-router","children":[{"id":2,"name":"RouteHref","kind":128,"kindString":"Class","flags":{"isExported":true},"children":[{"id":3,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":4,"name":"new RouteHref","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":5,"name":"router","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}},{"id":6,"name":"element","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"reference","name":"RouteHref","id":2}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":36,"character":32}]},{"id":7,"name":"attached","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":8,"name":"attached","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"intrinsic","name":"any"}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":38,"character":10}]},{"id":11,"name":"attributeChanged","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":12,"name":"attributeChanged","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":13,"name":"value","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}},{"id":14,"name":"previous","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"any"}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":40,"character":18}]},{"id":15,"name":"processChange","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":16,"name":"processChange","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"intrinsic","name":"any"}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":41,"character":15}]},{"id":9,"name":"unbind","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":10,"name":"unbind","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"intrinsic","name":"any"}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":39,"character":8}]}],"groups":[{"title":"Constructors","kind":512,"children":[3]},{"title":"Methods","kind":2048,"children":[7,11,15,9]}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":36,"character":30}]},{"id":17,"name":"RouterView","kind":128,"kindString":"Class","flags":{"isExported":true},"children":[{"id":23,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":24,"name":"new RouterView","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":25,"name":"element","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}},{"id":26,"name":"container","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}},{"id":27,"name":"viewSlot","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}},{"id":28,"name":"router","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}},{"id":29,"name":"viewLocator","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}},{"id":30,"name":"compositionTransaction","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}},{"id":31,"name":"compositionEngine","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"reference","name":"RouterView","id":17}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":48,"character":15}]},{"id":22,"name":"element","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"aurelia-templating-router.d.ts","line":48,"character":9}],"type":{"type":"intrinsic","name":"any"}},{"id":21,"name":"layoutModel","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"aurelia-templating-router.d.ts","line":47,"character":13}],"type":{"type":"intrinsic","name":"any"}},{"id":19,"name":"layoutView","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"aurelia-templating-router.d.ts","line":45,"character":12}],"type":{"type":"intrinsic","name":"any"}},{"id":20,"name":"layoutViewModel","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"aurelia-templating-router.d.ts","line":46,"character":17}],"type":{"type":"intrinsic","name":"any"}},{"id":18,"name":"swapOrder","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"aurelia-templating-router.d.ts","line":44,"character":11}],"type":{"type":"intrinsic","name":"any"}},{"id":35,"name":"bind","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":36,"name":"bind","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":37,"name":"bindingContext","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}},{"id":38,"name":"overrideContext","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"any"}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":51,"character":6}]},{"id":32,"name":"created","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":33,"name":"created","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":34,"name":"owningView","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"any"}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":50,"character":9}]},{"id":39,"name":"process","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":40,"name":"process","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":41,"name":"viewPortInstruction","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}},{"id":42,"name":"waitToSwap","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"any"}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":52,"character":9}]},{"id":43,"name":"swap","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":44,"name":"swap","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":45,"name":"viewPortInstruction","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"any"}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":53,"character":6}]}],"groups":[{"title":"Constructors","kind":512,"children":[23]},{"title":"Properties","kind":1024,"children":[22,21,19,20,18]},{"title":"Methods","kind":2048,"children":[35,32,39,43]}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":43,"character":31}]},{"id":46,"name":"RouterViewLocator","kind":128,"kindString":"Class","flags":{"isExported":true},"comment":{"shortText":"Locator which finds the nearest RouterView, relative to the current dependency injection container."},"children":[{"id":47,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"comment":{"shortText":"Creates an instance of the RouterViewLocator class."},"signatures":[{"id":48,"name":"new RouterViewLocator","kind":16384,"kindString":"Constructor signature","flags":{},"comment":{"shortText":"Creates an instance of the RouterViewLocator class."},"type":{"type":"reference","name":"RouterViewLocator","id":46}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":59,"character":40}]},{"id":49,"name":"findNearest","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":50,"name":"findNearest","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Finds the nearest RouterView instance.","returns":"A promise that will be resolved with the located RouterView instance.\n"},"type":{"type":"reference","name":"Promise","typeArguments":[{"type":"reference","name":"RouterView","id":17}]}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":70,"character":13}]}],"groups":[{"title":"Constructors","kind":512,"children":[47]},{"title":"Methods","kind":2048,"children":[49]}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":59,"character":38}]},{"id":51,"name":"TemplatingRouteLoader","kind":128,"kindString":"Class","flags":{"isExported":true},"children":[{"id":52,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":53,"name":"new TemplatingRouteLoader","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":54,"name":"compositionEngine","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"reference","name":"TemplatingRouteLoader","id":51}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":72,"character":64}]},{"id":55,"name":"loadRoute","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":56,"name":"loadRoute","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":57,"name":"router","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}},{"id":58,"name":"config","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"any"},"overwrites":{"type":"reference","name":"RouteLoader.loadRoute"}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":74,"character":11}],"overwrites":{"type":"reference","name":"RouteLoader.loadRoute"}}],"groups":[{"title":"Constructors","kind":512,"children":[52]},{"title":"Methods","kind":2048,"children":[55]}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":72,"character":42}],"extendedTypes":[{"type":"reference","name":"RouteLoader"}]}],"groups":[{"title":"Classes","kind":128,"children":[2,17,46,51]}]} | ||
{"name":"aurelia-templating-router","children":[{"id":2,"name":"RouteHref","kind":128,"kindString":"Class","flags":{"isExported":true},"children":[{"id":3,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":4,"name":"new RouteHref","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":5,"name":"router","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}},{"id":6,"name":"element","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"reference","name":"RouteHref","id":2}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":37,"character":32}]},{"id":11,"name":"attributeChanged","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":12,"name":"attributeChanged","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":13,"name":"value","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}},{"id":14,"name":"previous","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"any"}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":41,"character":18}]},{"id":7,"name":"bind","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":8,"name":"bind","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"intrinsic","name":"any"}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":39,"character":6}]},{"id":15,"name":"processChange","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":16,"name":"processChange","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"intrinsic","name":"any"}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":42,"character":15}]},{"id":9,"name":"unbind","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":10,"name":"unbind","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"intrinsic","name":"any"}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":40,"character":8}]}],"groups":[{"title":"Constructors","kind":512,"children":[3]},{"title":"Methods","kind":2048,"children":[11,7,15,9]}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":37,"character":30}]},{"id":17,"name":"RouterView","kind":128,"kindString":"Class","flags":{"isExported":true},"children":[{"id":23,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":24,"name":"new RouterView","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":25,"name":"element","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}},{"id":26,"name":"container","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}},{"id":27,"name":"viewSlot","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}},{"id":28,"name":"router","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}},{"id":29,"name":"viewLocator","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}},{"id":30,"name":"compositionTransaction","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}},{"id":31,"name":"compositionEngine","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"reference","name":"RouterView","id":17}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":49,"character":15}]},{"id":22,"name":"element","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"aurelia-templating-router.d.ts","line":49,"character":9}],"type":{"type":"intrinsic","name":"any"}},{"id":21,"name":"layoutModel","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"aurelia-templating-router.d.ts","line":48,"character":13}],"type":{"type":"intrinsic","name":"any"}},{"id":19,"name":"layoutView","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"aurelia-templating-router.d.ts","line":46,"character":12}],"type":{"type":"intrinsic","name":"any"}},{"id":20,"name":"layoutViewModel","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"aurelia-templating-router.d.ts","line":47,"character":17}],"type":{"type":"intrinsic","name":"any"}},{"id":18,"name":"swapOrder","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"aurelia-templating-router.d.ts","line":45,"character":11}],"type":{"type":"intrinsic","name":"any"}},{"id":35,"name":"bind","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":36,"name":"bind","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":37,"name":"bindingContext","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}},{"id":38,"name":"overrideContext","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"any"}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":52,"character":6}]},{"id":32,"name":"created","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":33,"name":"created","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":34,"name":"owningView","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"any"}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":51,"character":9}]},{"id":39,"name":"process","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":40,"name":"process","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":41,"name":"viewPortInstruction","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}},{"id":42,"name":"waitToSwap","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"any"}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":53,"character":9}]},{"id":43,"name":"swap","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":44,"name":"swap","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":45,"name":"viewPortInstruction","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"any"}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":54,"character":6}]}],"groups":[{"title":"Constructors","kind":512,"children":[23]},{"title":"Properties","kind":1024,"children":[22,21,19,20,18]},{"title":"Methods","kind":2048,"children":[35,32,39,43]}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":44,"character":31}]},{"id":46,"name":"RouterViewLocator","kind":128,"kindString":"Class","flags":{"isExported":true},"comment":{"shortText":"Locator which finds the nearest RouterView, relative to the current dependency injection container."},"children":[{"id":47,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"comment":{"shortText":"Creates an instance of the RouterViewLocator class."},"signatures":[{"id":48,"name":"new RouterViewLocator","kind":16384,"kindString":"Constructor signature","flags":{},"comment":{"shortText":"Creates an instance of the RouterViewLocator class."},"type":{"type":"reference","name":"RouterViewLocator","id":46}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":60,"character":40}]},{"id":49,"name":"findNearest","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":50,"name":"findNearest","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Finds the nearest RouterView instance.","returns":"A promise that will be resolved with the located RouterView instance.\n"},"type":{"type":"reference","name":"Promise","typeArguments":[{"type":"reference","name":"RouterView","id":17}]}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":71,"character":13}]}],"groups":[{"title":"Constructors","kind":512,"children":[47]},{"title":"Methods","kind":2048,"children":[49]}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":60,"character":38}]},{"id":51,"name":"TemplatingRouteLoader","kind":128,"kindString":"Class","flags":{"isExported":true},"children":[{"id":52,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":53,"name":"new TemplatingRouteLoader","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":54,"name":"compositionEngine","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"reference","name":"TemplatingRouteLoader","id":51}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":73,"character":64}]},{"id":55,"name":"loadRoute","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":56,"name":"loadRoute","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":57,"name":"router","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}},{"id":58,"name":"config","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"intrinsic","name":"any"}}],"type":{"type":"intrinsic","name":"any"},"overwrites":{"type":"reference","name":"RouteLoader.loadRoute"}}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":75,"character":11}],"overwrites":{"type":"reference","name":"RouteLoader.loadRoute"}}],"groups":[{"title":"Constructors","kind":512,"children":[52]},{"title":"Methods","kind":2048,"children":[55]}],"sources":[{"fileName":"aurelia-templating-router.d.ts","line":73,"character":42}],"extendedTypes":[{"type":"reference","name":"RouteLoader"}]}],"groups":[{"title":"Classes","kind":128,"children":[2,17,46,51]}]} |
@@ -0,1 +1,6 @@ | ||
<a name="1.3.2"></a> | ||
## [1.3.2](https://github.com/aurelia/templating-router/compare/1.3.1...1.3.2) (2018-07-03) | ||
* Update dependencies and leverate new framework configuration APIs. | ||
<a name="1.3.0"></a> | ||
@@ -2,0 +7,0 @@ # [1.3.0](https://github.com/aurelia/templating-router/compare/1.2.0...1.3.0) (2018-01-15) |
{ | ||
"name": "aurelia-templating-router", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "An implementation of the RouteLoader interface for use with the router module. Also contains a custom element that allows the templating engine to display the current route.", | ||
@@ -31,3 +31,3 @@ "keywords": [ | ||
"peerDependencies": { | ||
"aurelia-binding": "^1.3.0", | ||
"aurelia-binding": "^2.0.0", | ||
"aurelia-dependency-injection": "^1.0.0", | ||
@@ -39,6 +39,6 @@ "aurelia-logging": "^1.0.0", | ||
"aurelia-router": "^1.5.0", | ||
"aurelia-templating": "^1.5.0" | ||
"aurelia-templating": "^1.8.1" | ||
}, | ||
"dependencies": { | ||
"aurelia-binding": "^1.3.0", | ||
"aurelia-binding": "^2.0.0", | ||
"aurelia-dependency-injection": "^1.0.0", | ||
@@ -50,3 +50,3 @@ "aurelia-logging": "^1.0.0", | ||
"aurelia-router": "^1.5.0", | ||
"aurelia-templating": "^1.5.0" | ||
"aurelia-templating": "^1.8.1" | ||
}, | ||
@@ -65,3 +65,3 @@ "devDependencies": { | ||
"dependencies": { | ||
"aurelia-binding": "^1.3.0", | ||
"aurelia-binding": "^2.0.0", | ||
"aurelia-dependency-injection": "^1.0.0", | ||
@@ -73,3 +73,3 @@ "aurelia-logging": "^1.0.0", | ||
"aurelia-router": "^1.5.0", | ||
"aurelia-templating": "^1.5.0" | ||
"aurelia-templating": "^1.8.1" | ||
}, | ||
@@ -116,3 +116,3 @@ "devDependencies": { | ||
"through2": "^2.0.1", | ||
"typedoc": "^0.4.4", | ||
"typedoc": "^0.11.1", | ||
"typescript": "^1.9.0-dev.20160622-1.0", | ||
@@ -125,14 +125,3 @@ "vinyl": "^1.1.1", | ||
"aurelia-router": "^1.5.0" | ||
}, | ||
"aurelia": { | ||
"documentation": { | ||
"articles": [] | ||
}, | ||
"build": { | ||
"resources": [ | ||
"aurelia-templating-router/router-view", | ||
"aurelia-templating-router/route-href" | ||
] | ||
} | ||
} | ||
} |
@@ -1,2 +0,1 @@ | ||
import {PLATFORM} from 'aurelia-pal'; | ||
import {Router, AppRouter, RouteLoader} from 'aurelia-router'; | ||
@@ -12,4 +11,4 @@ import {TemplatingRouteLoader} from './route-loader'; | ||
.globalResources( | ||
PLATFORM.moduleName('./router-view'), | ||
PLATFORM.moduleName('./route-href') | ||
RouterView, | ||
RouteHref | ||
); | ||
@@ -16,0 +15,0 @@ |
@@ -30,4 +30,2 @@ import {inject} from 'aurelia-dependency-injection'; | ||
config = config || {}; | ||
let instruction = { | ||
@@ -34,0 +32,0 @@ viewModel: viewModel, |
@@ -0,22 +1,51 @@ | ||
import {TemplatingRouteLoader} from 'src/route-loader'; | ||
import {bootstrap} from 'aurelia-bootstrapper'; | ||
import {RouteLoader, AppRouter, Router} from 'aurelia-router'; | ||
import {StageComponent} from 'aurelia-testing'; | ||
import {bootstrap} from 'aurelia-bootstrapper'; | ||
describe('route-href', () => { | ||
/**@type {StageComponent} */ | ||
let component; | ||
afterEach(done => { | ||
component.dispose(); | ||
done(); | ||
}); | ||
it('should use route as primary property', done => { | ||
let component = StageComponent | ||
.withResources() | ||
.inView('<a route-href.bind="link"></a>') | ||
.boundTo({ link: 'home' }); | ||
component | ||
.create(bootstrap) | ||
component = StageComponent | ||
.withResources('src/route-href') | ||
.inView('<a route-href.bind="name"></a>') | ||
.boundTo({ name: 'b' }); | ||
configure(component); | ||
component.create(bootstrap) | ||
.then(() => { | ||
expect(component.viewModel.route).toBe('home'); | ||
expect(component.viewModel.route).toBe('b'); | ||
done(); | ||
component.dispose(); | ||
}).catch(e => { | ||
fail(e); | ||
component.dispose(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
function configure(component) { | ||
component.bootstrap(aurelia => { | ||
aurelia.use | ||
.defaultBindingLanguage() | ||
.defaultResources() | ||
.history(); | ||
aurelia.use | ||
.singleton(RouteLoader, TemplatingRouteLoader) | ||
.singleton(Router, AppRouter); | ||
aurelia.use.container.viewModel = { | ||
configureRouter: (config, router) => { | ||
config.map([ | ||
{ route: 'a', name: 'a' }, | ||
{ route: 'b', name: 'b' } | ||
]); | ||
} | ||
}; | ||
}); | ||
} |
@@ -1,11 +0,12 @@ | ||
import {StageComponent} from 'aurelia-testing'; | ||
import {RouteLoader, AppRouter, Router} from 'aurelia-router'; | ||
import {TemplatingRouteLoader} from 'src/route-loader'; | ||
import {testConstants} from 'test/test-constants'; | ||
import {bootstrap} from 'aurelia-bootstrapper'; | ||
import {RouteLoader, AppRouter, Router, RouteConfig, RouterConfiguration} from 'aurelia-router'; | ||
import {StageComponent} from 'aurelia-testing'; | ||
describe('router-view', () => { | ||
/**@type {StageComponent} */ | ||
let component; | ||
beforeEach(done => { | ||
window.location.hash = '#/'; | ||
done(); | ||
@@ -15,145 +16,233 @@ }); | ||
afterEach(done => { | ||
component.viewModel.router.navigate('default').then(() => { | ||
component.dispose(); | ||
done(); | ||
}); | ||
component.viewModel.router.deactivate(); | ||
component.dispose(); | ||
done(); | ||
}); | ||
it('has a router instance', done => { | ||
component = withDefaultViewport({ moduleId: 'test/module-default-slot' }); | ||
component = withDefaultViewport(); | ||
component.create(bootstrap) | ||
.then(() => { | ||
expect(component.viewModel.router).not.toBe(undefined); | ||
expect(component.viewModel.router).toBeDefined(); | ||
done(); | ||
}) | ||
.then(done); | ||
}); | ||
it('loads a non-layout based view', done => { | ||
component = withDefaultViewport({ moduleId: 'test/module-default-slot' }); | ||
it('loads a basic view / view-model', done => { | ||
component = withDefaultViewport({ moduleId: 'test/routes/route-2' }); | ||
component.create(bootstrap) | ||
.then(() => { | ||
return component.viewModel.router.navigate('route').then(wait); | ||
expect(component.element.querySelectorAll('.route-1').length).toBe(1); | ||
expect(component.element.querySelectorAll('.route-2').length).toBe(0); | ||
return component.viewModel.router.navigate('route'); | ||
}) | ||
.then(() => { | ||
expect(component.viewModel.element.innerText).toContain(testConstants.content); | ||
}) | ||
.then(done); | ||
expect(component.element.querySelectorAll('.route-1').length).toBe(0); | ||
expect(component.element.querySelectorAll('.route-2').length).toBe(1); | ||
done(); | ||
}); | ||
}); | ||
it('loads a view-only layout', done => { | ||
component = withDefaultViewport({ moduleId: 'test/module-default-slot', layoutView: 'test/layout-default-slot.html' }); | ||
it('loads a view-only module', done =>{ | ||
component = withDefaultViewport({ moduleId: 'test/routes/route-2.html' }); | ||
component.create(bootstrap) | ||
.then(() => { | ||
return component.viewModel.router.navigate('route').then(wait); | ||
expect(component.element.querySelectorAll('.route-1').length).toBe(1); | ||
expect(component.element.querySelectorAll('.route-2.view-only').length).toBe(0); | ||
return component.viewModel.router.navigate('route'); | ||
}) | ||
.then(() => { | ||
expect(component.viewModel.element.innerText).toContain(testConstants.content); | ||
expect(component.viewModel.element.innerText).toContain(testConstants.defaultLayout); | ||
}) | ||
.then(done); | ||
expect(component.element.querySelectorAll('.route-1').length).toBe(0); | ||
expect(component.element.querySelectorAll('.route-2.view-only').length).toBe(1); | ||
done(); | ||
}); | ||
}); | ||
it('loads a view-only module', done =>{ | ||
component = withDefaultViewport({ moduleId: 'test/module-view-only.html' }); | ||
describe('with layouts', () => { | ||
component.create(bootstrap) | ||
.then(() => { | ||
return component.viewModel.router.navigate('route').then(wait); | ||
}) | ||
.then(() => { | ||
expect(component.viewModel.element.innerText).toContain('view-only content'); | ||
}) | ||
.then(done); | ||
}); | ||
it('loads a module based layout', done => { | ||
component = withDefaultViewport({ moduleId: 'test/routes/route-2', layoutViewModel: 'test/routes/layout-1' }); | ||
it('loads a module based layout', done => { | ||
component = withDefaultViewport({ moduleId: 'test/module-default-slot', layoutViewModel: 'test/layout-default-slot' }); | ||
component.create(bootstrap) | ||
.then(() => { | ||
expect(component.element.querySelectorAll('.route-1').length).toBe(1); | ||
expect(component.element.querySelectorAll('.route-2').length).toBe(0); | ||
expect(component.element.querySelectorAll('.layout-1').length).toBe(0); | ||
return component.viewModel.router.navigate('route'); | ||
}) | ||
.then(wait) | ||
.then(() => { | ||
expect(component.element.querySelectorAll('.route-1').length).toBe(0); | ||
expect(component.element.querySelectorAll('.route-2:not(.view-only)').length).toBe(1); | ||
expect(component.element.querySelectorAll('.layout-1:not(.view-only)').length).toBe(1); | ||
done(); | ||
}); | ||
}); | ||
component.create(bootstrap) | ||
.then(() => { | ||
return component.viewModel.router.navigate('route').then(wait); | ||
}) | ||
.then(() => { | ||
expect(component.viewModel.element.innerText).toContain(testConstants.content); | ||
expect(component.viewModel.element.innerText).toContain(testConstants.defaultLayout); | ||
expect(component.viewModel.viewSlot.children[0].controller.viewModel).not.toBe(undefined); | ||
}) | ||
.then(done); | ||
}); | ||
it('loads a view-only layout', done => { | ||
component = withDefaultViewport({ moduleId: 'test/routes/route-2', layoutView: 'test/routes/layout-1.html' }); | ||
component.create(bootstrap) | ||
.then(() => { | ||
expect(component.element.querySelectorAll('.route-1').length).toBe(1); | ||
expect(component.element.querySelectorAll('.route-2').length).toBe(0); | ||
expect(component.element.querySelectorAll('.layout-1').length).toBe(0); | ||
return component.viewModel.router.navigate('route'); | ||
}) | ||
.then(wait) | ||
.then(() => { | ||
expect(component.element.querySelectorAll('.route-1').length).toBe(0); | ||
expect(component.element.querySelectorAll('.route-2:not(.view-only)').length).toBe(1); | ||
expect(component.element.querySelectorAll('.layout-1.view-only').length).toBe(1); | ||
done(); | ||
}); | ||
}); | ||
it('loads a module based layout with a specific view', done => { | ||
component = withDefaultViewport({ moduleId: 'test/module-default-slot', layoutView: 'test/layout-default-slot-alt.html', layoutViewModel: 'test/layout-default-slot' }); | ||
it('loads a module based layout with a specific view', done => { | ||
component = withDefaultViewport({ moduleId: 'test/routes/route-2', layoutView: 'test/routes/layout-1.html', layoutViewModel: 'test/routes/layout-2' }); | ||
component.create(bootstrap) | ||
.then(() => { | ||
return component.viewModel.router.navigate('route').then(wait); | ||
}) | ||
.then(() => { | ||
expect(component.viewModel.element.innerText).toContain(testConstants.content); | ||
expect(component.viewModel.element.innerText).toContain(testConstants.altLayout); | ||
expect(component.viewModel.viewSlot.children[0].controller.viewModel).not.toBe(undefined); | ||
}) | ||
.then(done); | ||
}); | ||
component.create(bootstrap) | ||
.then(() => { | ||
expect(component.element.querySelectorAll('.route-1').length).toBe(1); | ||
expect(component.element.querySelectorAll('.route-2').length).toBe(0); | ||
expect(component.element.querySelectorAll('.layout-1').length).toBe(0); | ||
expect(component.element.querySelectorAll('.layout-2').length).toBe(0); | ||
return component.viewModel.router.navigate('route'); | ||
}) | ||
.then(wait) | ||
.then(() => { | ||
expect(component.element.querySelectorAll('.route-1').length).toBe(0); | ||
expect(component.element.querySelectorAll('.route-2').length).toBe(1); | ||
expect(component.element.querySelectorAll('.layout-1:not(.view-only)').length).toBe(1); | ||
expect(component.element.querySelectorAll('.layout-2:not(.view-only)').length).toBe(1); | ||
done(); | ||
}); | ||
}); | ||
it('loads a layout with multiple slots', done => { | ||
component = withDefaultViewport({ moduleId: 'test/module-named-slots', layoutView: 'test/layout-named-slots.html' }); | ||
it('loads a layout with multiple slots', done => { | ||
component = withDefaultViewport({ moduleId: 'test/routes/multiple-slots-route-1', layoutView: 'test/routes/multiple-slots-layout-1.html' }); | ||
component.create(bootstrap) | ||
.then(() => { | ||
return component.viewModel.router.navigate('route').then(wait); | ||
}) | ||
.then(() => { | ||
expect(component.viewModel.element.innerText).toContain(testConstants.content + '\n' + testConstants.content); | ||
expect(component.viewModel.element.innerText).toContain(testConstants.namedSlotsLayout); | ||
}) | ||
.then(done); | ||
}); | ||
component.create(bootstrap) | ||
.then(() => { | ||
expect(component.element.querySelectorAll('.route-1').length).toBe(1); | ||
expect(component.element.querySelectorAll('.multiple-slots-layout-1').length).toBe(0); | ||
expect(component.element.querySelectorAll('.multiple-slots-route-1-slot-1').length).toBe(0); | ||
expect(component.element.querySelectorAll('.multiple-slots-route-1-slot-2').length).toBe(0); | ||
return component.viewModel.router.navigate('route'); | ||
}) | ||
.then(wait) | ||
.then(() => { | ||
expect(component.element.querySelectorAll('.route-1').length).toBe(0); | ||
expect(component.element.querySelectorAll('.multiple-slots-layout-1.view-only').length).toBe(1); | ||
expect(component.element.querySelectorAll('.multiple-slots-route-1-slot-1:not(.view-only)').length).toBe(1); | ||
expect(component.element.querySelectorAll('.multiple-slots-route-1-slot-2:not(.view-only)').length).toBe(1); | ||
done(); | ||
}); | ||
}); | ||
it('loads layouts for a named viewport', done => { | ||
component = withNamedViewport({ | ||
viewPorts: { | ||
viewport1: { moduleId: 'test/module-default-slot', layoutView: 'test/layout-default-slot.html' } | ||
} | ||
it('loads layouts for a named viewport', done => { | ||
component = withNamedViewport({ | ||
viewPorts: { | ||
viewport1: { moduleId: 'test/routes/route-2', layoutViewModel: 'test/routes/layout-1' } | ||
} | ||
}); | ||
component.create(bootstrap) | ||
.then(() => { | ||
expect(component.element.querySelectorAll('.route-1').length).toBe(1); | ||
expect(component.element.querySelectorAll('.route-2').length).toBe(0); | ||
expect(component.element.querySelectorAll('.layout-1').length).toBe(0); | ||
return component.viewModel.router.navigate('route'); | ||
}) | ||
.then(wait) | ||
.then(() => { | ||
expect(component.element.querySelectorAll('.route-1').length).toBe(0); | ||
expect(component.element.querySelectorAll('.route-2:not(.view-only)').length).toBe(1); | ||
expect(component.element.querySelectorAll('.layout-1:not(.view-only)').length).toBe(1); | ||
done(); | ||
}); | ||
}); | ||
component.create(bootstrap) | ||
.then(() => { | ||
return component.viewModel.router.navigate('route').then(wait); | ||
}) | ||
.then(() => { | ||
expect(component.viewModel.element.innerText).toContain(testConstants.content); | ||
expect(component.viewModel.element.innerText).toContain(testConstants.defaultLayout); | ||
}) | ||
.then(done); | ||
}); | ||
it('activates the layout viewmodel with a model value', done => { | ||
const params = 1; | ||
component = withDefaultViewport({ moduleId: 'test/routes/route-2', layoutViewModel: 'test/routes/layout-1', layoutModel: params }); | ||
it('activates the layout viewmodel with a model value', done => { | ||
component = withDefaultViewport({ moduleId: 'test/module-default-slot', layoutViewModel: 'test/layout-default-slot', layoutModel: 1 }); | ||
component.create(bootstrap) | ||
.then(() => { | ||
expect(component.element.querySelectorAll('.route-1').length).toBe(1); | ||
expect(component.element.querySelectorAll('.route-2').length).toBe(0); | ||
expect(component.element.querySelectorAll('.layout-1').length).toBe(0); | ||
return component.viewModel.router.navigate('route'); | ||
}) | ||
.then(wait) | ||
.then(() => { | ||
expect(component.element.querySelectorAll('.route-1').length).toBe(0); | ||
expect(component.element.querySelectorAll('.route-2:not(.view-only)').length).toBe(1); | ||
expect(component.element.querySelectorAll(`.layout-1[data-activate="${params}"]`).length).toBe(1); | ||
done(); | ||
}); | ||
}); | ||
component.create(bootstrap) | ||
.then(() => { | ||
return component.viewModel.router.navigate('route').then(wait); | ||
}) | ||
.then(() => { | ||
expect(component.viewModel.viewSlot.children[0].controller.viewModel.value).toBe(1); | ||
}) | ||
.then(done); | ||
// INFO [Matt] This failing test is a bug that needs to get resolved, but | ||
// it is existing and apprarently not critical. References to existing issues | ||
// appreciated. | ||
// it('resolves the navigate promise when navigation is complete', done => { | ||
// component = withDefaultViewport({ moduleId: 'test/routes/route-2', layoutViewModel: 'test/routes/layout-1' }); | ||
// component.create(bootstrap) | ||
// .then(() => { | ||
// expect(component.element.querySelectorAll('.route-1').length).toBe(1); | ||
// expect(component.element.querySelectorAll('.route-2').length).toBe(0); | ||
// expect(component.element.querySelectorAll('.layout-1').length).toBe(0); | ||
// return component.viewModel.router.navigate('route'); | ||
// }) | ||
// .then(() => { | ||
// expect(component.element.querySelectorAll('.route-1').length).toBe(0); | ||
// expect(component.element.querySelectorAll('.route-2:not(.view-only)').length).toBe(1); | ||
// expect(component.element.querySelectorAll('.layout-1:not(.view-only)').length).toBe(1); | ||
// done(); | ||
// }); | ||
// }); | ||
}); | ||
it('locates the view port before activating', done => { | ||
component = withDefaultViewport({ moduleId: 'test/module-default-slot', layoutViewModel: 'test/layout-default-slot' }); | ||
// INFO [Matt] TODO [Binh] Attached isn't being called properly. | ||
// it('supports classes as a module id', (done) => { | ||
// const { Route2ViewModel } = require('test/routes/route-2'); | ||
component.create(bootstrap) | ||
.then(() => { | ||
return component.viewModel.router.navigate('route').then(wait); | ||
}) | ||
.then(() => { | ||
expect(component.viewModel.viewSlot.children[0].controller.viewModel.routerViewLocated).toBe(true); | ||
}) | ||
.then(done); | ||
}); | ||
// component = withDefaultViewport({ moduleId: Route2ViewModel }); | ||
// component.create(bootstrap) | ||
// .then(() => { | ||
// expect(component.element.querySelectorAll('.route-1').length).toBe(1); | ||
// expect(component.element.querySelectorAll('.route-2').length).toBe(0); | ||
// return component.viewModel.router.navigate('route'); | ||
// }) | ||
// .then(() => { | ||
// expect(component.element.querySelectorAll('.route-1').length).toBe(0); | ||
// expect(component.element.querySelectorAll('.route-2:not(.view-only)').length).toBe(1); | ||
// done(); | ||
// }); | ||
// }); | ||
// INFO [Matt] Not supported. | ||
// it('supports objects as a module id', (done) => { | ||
// const { Route2ViewModel } = require('test/routes/route-2'); | ||
// component = withDefaultViewport({ moduleId: new Route2ViewModel() }); | ||
// component.create(bootstrap) | ||
// .then(() => { | ||
// expect(component.element.querySelectorAll('.route-1').length).toBe(1); | ||
// expect(component.element.querySelectorAll('.route-2').length).toBe(0); | ||
// return component.viewModel.router.navigate('route'); | ||
// }) | ||
// .then(() => { | ||
// expect(component.element.querySelectorAll('.route-1').length).toBe(0); | ||
// expect(component.element.querySelectorAll('.route-2:not(.view-only)').length).toBe(1); | ||
// done(); | ||
// }); | ||
// }); | ||
}); | ||
@@ -165,2 +254,5 @@ | ||
/** | ||
* @param {RouteConfig} routeConfig | ||
*/ | ||
function withDefaultViewport(routeConfig) { | ||
@@ -173,3 +265,3 @@ let component = StageComponent | ||
route: ['', 'default'], | ||
moduleId: 'test/module-default-slot', | ||
moduleId: 'test/routes/route-1', | ||
activationStrategy: 'replace' | ||
@@ -181,2 +273,5 @@ }, routeConfig); | ||
/** | ||
* @param {RouteConfig} routeConfig | ||
*/ | ||
function withNamedViewport(routeConfig) { | ||
@@ -190,3 +285,3 @@ let component = StageComponent | ||
viewPorts: { | ||
viewport1: { moduleId: 'test/module-default-slot' } | ||
viewport1: { moduleId: 'test/routes/route-1' } | ||
}, | ||
@@ -199,2 +294,7 @@ activationStrategy: 'replace' | ||
/** | ||
* @param {StageComponent} component | ||
* @param {RouteConfig} defaultRoute | ||
* @param {RouteConfig} routeConfig | ||
*/ | ||
function configure(component, defaultRoute, routeConfig) { | ||
@@ -201,0 +301,0 @@ component.bootstrap(aurelia => { |
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
280722
3952
85
- Removedaurelia-binding@1.7.3(transitive)
Updatedaurelia-binding@^2.0.0
Updatedaurelia-templating@^1.8.1