
Aurelia
文章平均质量分 67
闲逛上海滩
闲逛上海滩
展开
-
前端框架Aurelia——组件Component(一)
In Aurelia, user interface components are composed of view and view-model pairs.组件由html和.ts或者.js文件为一组。Once instantiated, Aurelia's powerful databinding links the two pieces together allowing c原创 2017-03-21 19:06:39 · 2016 阅读 · 0 评论 -
前端框架Aurelia - GlobalResources()
Introduction你可能有许多资源需要在多个页面使用。这时候将这些资源做成全局的是明智的。 框架配置class提供了globalResources方法,这个方法的参数是一个或者多个string,这些string是资源的path。 全局的resources不需要在template里面require。 配置Aurelia的文件有一个configure方法。我们项目里面layout文件夹下的i原创 2017-05-08 14:26:57 · 864 阅读 · 0 评论 -
前端框架Aurelia - 自定义组件
自定义元素(组件)- 含有ViewModel的自定义组件.ts文件 1.首先我们要引入两个依赖!customElement和bindable。 2.下面这个例子还示意了如何给自定义组件绑定属性to,我们使用@bindable来绑定。 3.我们在这里用@customElement(“say-hello”)来定义这个自定义组件的名字,也是我们在使用这个自定义组件的时候的标签名。import {cu原创 2017-05-08 11:27:22 · 1634 阅读 · 0 评论 -
EventAggregator
http://aurelia.io/hub.html#/doc/api/aurelia/event-aggregator/latest/class/EventAggregatorIntroductionEnables loosely coupled publish/subscribe messaging. new EventAggregator()Methods原创 2017-05-08 10:44:45 · 476 阅读 · 0 评论 -
前端框架Aurelia —— 路由Router
基本配置为了使用Aurelia的路由,我们的组件view必须有一个元素。为了配置路由,组件的VM需要一个configureRouter()方法。app.html<template> <router-view></router-view></template>Route Configureexport class App { configureRouter(config, router) {原创 2017-05-04 17:42:37 · 1757 阅读 · 1 评论 -
前端框架Aurelia - Value Converter
1.Value ConverterAurelia的value converter的改进:The Aurelia ValueConverter interface uses toView and fromView methods, which make it quite clear which direction the data is flowing. This原创 2017-03-23 20:59:08 · 859 阅读 · 0 评论 -
前端框架Aurelia - Computed Properties
import {computedFrom} from 'aurelia-framework';export class Person { firstName: string = 'John'; lastName: string = 'Doe'; @computedFrom('firstName', 'lastName') get fullName(): string {原创 2017-03-23 20:17:36 · 691 阅读 · 0 评论 -
前端框架Aurelia - Delegate vs Trigger
1.When use whichThe short answer is: Use delegate except when you cannot use delegate.哈哈哈哈写文档的真的太可爱了。Event delegation is a technique used to improve application performance. It dra原创 2017-03-23 20:05:54 · 1173 阅读 · 0 评论 -
前端框架Aurelia - Binding Selects(一)
1.IntruductionA element can serve as a single-select or multiple-select "picker" depending on whether the multiple attribute is present.select元素可以是单选也可以是多选,在于multiple属性是否存在。配置sele原创 2017-03-23 19:43:04 · 714 阅读 · 0 评论 -
前端框架Aurelia - Binding Radios
1.IntroductionA group of radio inputs is a type of "single select" interface.单选按钮。Aurelia supports two-way binding any type of property to a group of radio inputs.Aurelia支持双向绑定任何类型的属性与原创 2017-03-23 16:17:39 · 608 阅读 · 0 评论 -
前端框架Aurelia - Binding Checkbox
1.checkedBind a boolean property to an input element's checked attribute using checked.bind="myBooleanProperty".绑定一个bool类型的值给checked属性来决定checkbox是否check。export class App { motherbo原创 2017-03-22 19:46:48 · 735 阅读 · 0 评论 -
前端框架Aurelia - Class & Style
1.ClassYou can bind a css string or object to an element's style attribute. Use the style attribute's alias, css when doing string interpolation to ensure your application is compatible with I原创 2017-03-22 15:45:23 · 651 阅读 · 0 评论 -
前端框架Aurelia - 数据绑定bind(二)
1.String Interpolation字符串插值(羞耻的字眼==)String interpolation expressions enable interpolating (surprise!) the result of an expression with text. 将表达式的结果插入text。 example compared string原创 2017-03-22 15:04:59 · 986 阅读 · 0 评论 -
前端框架Aurelia - 数据绑定bind(一)
1.HTML and SVG AttributesAurelia supports binding HTML and SVG attributes to JavaScript expressions. Attribute binding declarations have three parts: attribute.command="expression".attri原创 2017-03-22 13:21:25 · 1015 阅读 · 0 评论 -
前端框架Aurelia - 依赖注入Dependency Injection(一)
Let's say we have a CustomerEditScreen that needs to load a Customer entity by ID from a web service. We wouldn't want to place all the details of our AJAX implementation inside our CustomerEditSc原创 2017-03-22 10:04:24 · 1065 阅读 · 0 评论 -
前端框架Aurelia——组件Component(二)组件生命周期
constructor() - The view-model's constructor is called first.created(owningView: View, myView: View)The created callback will receive the instance of the "owningView". This is the view that th原创 2017-03-21 20:19:30 · 1397 阅读 · 0 评论 -
前端框架Aurelia - feature()
Introduction有时,您拥有完整的组件或相关功能,它们共同构成了一个“特性”。这个“特性”甚至可能是由您的团队中的一组特定的开发人员所拥有的。你想要这些开发者能够管理自己的资源配置和功能,而不干扰其他地区的应用。对于这个场景,水母提供了“特性”特性。想象一下,如上所述,我们有一个my-component组件。想象一下,这是在你的应用中形成了一个逻辑功能的十几个组件之一。与其将该功能的配置逻辑原创 2017-05-08 14:56:59 · 1305 阅读 · 0 评论