aurelia

Karma not running simple typescript test (using SystemJS + Jasmine)

偶尔善良 提交于 2019-12-11 09:05:35
问题 I have been struggling with running a very simple typescript unit test that returns "hello" using Karma, Jasmine, SystemJs. Grabbed the project from Aurelia Typescript ASP.NET Core skeleton here but since then I've got no luck in running the unit tests even those included in the skeleton much less with e2e tests. Since it is from the aurelia skeleton, I am using 'gulp test' to run the unit test. Thanks for your help!! so when running I am getting : 665:DEBUG [config]: autoWatch set to false,

How to install/setup Aurelia router/routes

回眸只為那壹抹淺笑 提交于 2019-12-11 07:34:48
问题 I want a few links at the top of my page, and when they are clicked, different views are presented to the user on the same page. I want to set this up from scratch. I've seen a few examples online of this working but when I try to set it up from scratch using the Arelia todo example as a baseline (http://aurelia.io/hub.html#/doc/article/aurelia/framework/latest/quick-start), I seem to missing something. I assume I need to install the Aurelia router but there are no instruction anywhere to do

Aurelia with ASP.NET Core 2.0: Unable to find module with ID: resources/index

倖福魔咒の 提交于 2019-12-11 07:32:53
问题 I created a Visual Studio 2017 ASP.NET Core 2.0 solution by using the SPA Aurelia template. Everything works fine so far but I don't get the configuration (in "boot.ts") to find my "resources/elements" folder (or it's index.ts): export function configure(aurelia: Aurelia) { aurelia.use .standardConfiguration() .feature(PLATFORM.moduleName('resources')); "Unable to find module with ID: resources/index at WebpackLoader. (aurelia-loader-webpack.js:187)" The index.ts: import {

Custom view location in Aurelia

北城以北 提交于 2019-12-11 07:27:15
问题 I'm trying to get Aurelia to use a Razor view(.cshtml) instead of regular .html and the proposed way to do it is to override convertOriginToViewUrl with the appropriate code. In my case a route to the action that returns PartialViews. import {ViewLocator} from 'aurelia-framework'; export function configure(aurelia) { aurelia.use .standardConfiguration() .developmentLogging(); ViewLocator.prototype.convertOriginToViewUrl = (origin) => { return "/template?view=" + origin.moduleId; }; aurelia

Pass data to not-yet-loaded view in Aurelia

六月ゝ 毕业季﹏ 提交于 2019-12-11 06:31:43
问题 I am navigating from one view (call it bestSellersView) to another (BookDetailsView). There are multiple different 'parent' views that can navigate to 'Book Details' and they all need to pass the book that is to be viewed to the next view. I don't want to inject the source view to the details view as some threads suggest since my constructor would grow with each new view that uses the details sub-view. I am trying to use the event aggregator, however due to the life cycle of things I am

Aurelia using featherjs dependency failing to properly import

谁都会走 提交于 2019-12-11 06:25:22
问题 How do you import featherjs using the style common in Aurelia projects. This is what I have: in the build file aurelia.json "dependencies": [ { "name": "socket.io-client", "path": "../node_modules/socket.io-client/dist/socket.io.min" }, { "name": "feathers", "path": "../node_modules/feathers", "main": "client", "env": "dev" }, "aurelia-binding", In the app.js import io from 'socket.io-client'; import feathers from 'feathers'; //import socketio from 'feathers-socketio'; export class App {

Aurelia JS - cannot navigate route parent with click (Route not found)?

扶醉桌前 提交于 2019-12-11 06:03:47
问题 I tried to change the contact list tutorial: http://aurelia.io/hub.html#/doc/article/aurelia/framework/latest/contact-manager-tutorial/1 ... such that it starts with a "click me" button/div, which would then load the rest of the contact list app as it was. So in order to do that, I: Copied old app.* to app-clist.* New app.* just has a <router-view> and manages the routing/navigation Added btn-start.* which just contains a div, which on click should navigate the route to app-clist . This is

Aurelia Testing Composed Custom Element

孤街浪徒 提交于 2019-12-11 05:46:15
问题 Unit testing question: When I test a component as per aurelia.io example, ... component = StageComponent .withResources('components/comp/comp') .inView('<comp data.bind="info"></comp>') .boundTo({info: data}); ... I can query document and check attribute values of DOM nodes. const nameElement = document.getElementById('elem-id'); When I try testing a composed element, ... component = StageComponent .withResources('components/elemy/elemy') .inView('<compose view.bind="components/elemy/elemy

Aurelia: How can I modify sidebar content from inside a router view?

时光总嘲笑我的痴心妄想 提交于 2019-12-11 05:06:40
问题 I'm trying to wrap my head around how "inner components" can adjust the content of "outer components". Let's say I have an application template that looks something like this: <template> <div class="sidebar"> <div>Some app-wide content</div> <div> <!-- I want to put some view-specific content here --> </div> </div> <div class="main-body"> <router-view></router-view> </div> </template> Each subview wants to render different content to the sidebar. Obviously this would be easy if the subview

Cannot start Aurelia app without eval()

假装没事ソ 提交于 2019-12-11 04:52:44
问题 I have a working Aurelia SPA web app, but if I set in my web.config the Content-Security-Policy option like this <add name="X-Content-Security-Policy" value="default-src 'none'; frame-src 'self'; script-src 'self' https://code.jquery.com; connect-src 'self' https://*.core.windows.net; img-src 'self' data:; style-src 'self' https://fonts.googleapis.com 'unsafe-inline'; font-src https://fonts.gstatic.com 'self';"></add> I get this error on page load Uncaught (in promise) Error: (SystemJS)