aurelia

Run Aurelia Framework without NodeJs and JSPM

萝らか妹 提交于 2019-12-03 02:29:22
I am learning Aurelia Framework. I seen its document given example in NodeJs and JSPM. But I don't have NodeJs and JSPM. I am from .Net background. Its possible to run Aurelia Framework without install NodeJS. I want run Aurelia Framework just like add tag and add CDN link. Its possible ? You can write and execute Aurelia in Visual Studio without NodeJS or JSPM. Here is a port of the Aurelia skeleton-navigation to TypeScript which uses a bundle of the Aurelia AMD Libraries. You should be able to clone the repo and then load this up in Visual Studio and run the app (using Chrome) without any

Error handling for fetch() in Aurelia

99封情书 提交于 2019-12-02 19:17:36
I have an API that includes a useful description of what went wrong when an error is raised by the server (status = 500). The description comes as part of the response text. My client code, using Aurelia, calls the api via aurelia-fetch-client using a generic method to make the call: function callRemoteService(apiName, timeout) { return Promise.race([ this.http.fetch(apiName), this.waitForServer(timeout || 5000) // throws after x ms ]) .then(response => response.json() ) .catch(err => { if (err instanceof Response) { // HERE'S THE PROBLEM..... err.text().then(text => { console.log('Error text

How to set up minimal Aurelia project from scratch

大城市里の小女人 提交于 2019-12-02 16:09:28
When installing the Aurelia navigation skeleton app it is far to overwhelming with all the 3rd party modules and ready-made scripts it uses. For me who have a good picture of what most of it is in theory, have a hard time learning when I can't do it one step at a time. For this reason I would like to set up a minimal Aurelia project by myself and then add complexity to it as I go along. Main question: Which steps are necessary to set up a simple Aurelia project? Assumptions: I already have a Node server backend that can serve files. I want to use ES6/7 (Babel). I want to use system.js for

Aurelia JS - Making a synchronous HTTP request, to change data before page load?

戏子无情 提交于 2019-12-02 15:24:00
问题 I'm working with the contact list tutorial: http://aurelia.io/hub.html#/doc/article/aurelia/framework/latest/contact-manager-tutorial/1 ... and I wanted to change it, so the application first starts with a "click me" button. Upon click on this button, a web request should be made, which should return JSON contact data. If the request is successful, the response should update the main data store of contacts, and the page should start with rendering the new contact list; if the request fails,

Aurelia js fie upload to server

ε祈祈猫儿з 提交于 2019-12-02 13:14:08
Hi am new to aurelia js , i need to upload file to server,am using autrelia js, materializecss and httpClient.fetch for api call. I dont'know how to send file to server. view : <input type="file" files.bind="selectedFiles" change.delegate="onSelectFile($event)"> Model : onSelectFile(e) { var myurl = 'http://cdn.dmsapp.tk/file?authToken=bLNYMtfbHntfloXBuGlSPueilaHtZx&type=jpg&name=sibi.jpg&userId=7&organizationId=1&sourceType=USER_UPLOADS'; this.httpValueConverter.call_http(myurl,'POST',this.selectedFiles[],'fileupload',file_upload) .then(data => { console.log(data); if(data.meta && data.meta

Using CKEditor with Aurelia

↘锁芯ラ 提交于 2019-12-02 10:06:46
问题 Does anyone have a good working example of how to use CKEditor in Aurelia? I try this code in my template file but get the following error: <template> <require from="../../../jspm_packages/npm/ckeditor@4.5.10/ckeditor.js"></require> <textarea name="editor1" id="editor1"></textarea> <script> CKEDITOR.replace('editor1'); </script> </template> Error: c[a] is undefined system.js 4992:13 回答1: This example works well in ESNext/SystemJS skeleton. First, install ckeditor via jspm: jspm install npm

Customizing Aurelia to use .cshtml

一个人想着一个人 提交于 2019-12-02 09:39:32
问题 I found a very helpful article showing how to use Razor partials (cshtml) with aurelia. However, I could not get the code to run and learned from RobEisenberg comment that ConventionalViewStrategy.convertModuleIdToViewUrl had been deprecated. He commented "You want to use the ViewLocator service." I followed the gitHUb project and could not see that it was directly relevant to my using with MVC5 and Razor Partials. So I am confused. This is the example main.js file that I was hoping I could

How to run SystemJs module when view loads

江枫思渺然 提交于 2019-12-02 08:25:12
I have a component that loads a javascript module that builds on Bootstrap.js and Jquery to automatically build a table of contents for a page based on H1,H2,... headers. The component code is as follows: import { bindable, bindingMode, customElement, noView } from 'aurelia-framework'; @noView() @customElement('scriptinjector') export class ScriptInjector { @bindable public url; @bindable public isLocal; @bindable public isAsync; @bindable({ defaultBindingMode: bindingMode.oneWay }) protected scripttag; private tagId = 'bootTOCscript'; public attached() { if (this.url) { this.scripttag =

Using CKEditor with Aurelia

旧时模样 提交于 2019-12-02 06:21:32
Does anyone have a good working example of how to use CKEditor in Aurelia? I try this code in my template file but get the following error: <template> <require from="../../../jspm_packages/npm/ckeditor@4.5.10/ckeditor.js"></require> <textarea name="editor1" id="editor1"></textarea> <script> CKEDITOR.replace('editor1'); </script> </template> Error: c[a] is undefined system.js 4992:13 This example works well in ESNext/SystemJS skeleton. First, install ckeditor via jspm: jspm install npm:ckeditor Now, let's create out editor based on CKEDITOR. I named it as editor : editor.html: <template>

Webpack regex test that matches *.ts but not *.d.ts

旧街凉风 提交于 2019-12-02 05:51:20
问题 I am using Webpack (2.3.3) to build my Aurelia app in TS. However, since I am using includeAll option for AureliaPlugin (2.0.0-rc.2), ts-loader (2.0.3) cries about d.ts files that has nothing exported emitting no output. here is my rule for ts files: { test: /\.ts$/, include: /ClientApp/, use: "ts-loader" } I need to change the test value in a way that it matches files named *.ts except *.d.ts. Can you help me please? Note: I see there is already a similar regex question but that one did not