dalijs
v0.0.33
Published
ES6 framework
Downloads
28
Maintainers
Readme
dali
ES6 framework for creating web applications.
Introduction
dali use babel to compile ES6 code into ES5.
dali allows to use features of ES6 and some of ES7 like decorators, class properties, export extensions or function bind syntax.
dali is currently in development phase. We don't recommend using for production applications.
Installation
dali is available on npm.
$ npm install dalijs
Decorators
Decorators make it possible to annotate and modify classes and properties at design time.
@Component
- Name
import {Component} from 'dali';
@Component({
name : 'my-component'
})
class MyComponent {
}
@Inject
import {Inject} from 'dali';
class Test {
myMethod() {}
}
@Inject(Test)
class MyComponent {
constructor(test) {
test.myMethod();
}
}
@Directive
- Name
import {Directive} from 'dali';
@Directive({
name : 'my-directive'
})
class MyDirective {
render(data, element, value) {
}
}
@Filter
import {Filter} from 'dali';
@Filter
export class JsonFilter {
render(value) {
return JSON.stringify(value);
}
}
@RouterConfig
- Title
- Default
- Path
import {RouterConfig} from 'dali';
@RouterConfig({
title: 'Module 1',
default: true,
path : '/path'
})
@Runnable
import {Runnable} from 'dali';
@Runnable
class Test {
}
@View
- Template
- TemplateURL
import {View} from 'dali';
@View({
templateUrl: 'module1/module1_view.html'
})
class Test {
}
@Bindable
import {Bindable} from 'dali';
class Test {
@Bindable
name;
}
@Json
import {Json} from 'dali';
@Json
class Test {
}
Test.fromJson(...)
var model = new Test();
test.toJson();
@JsonPropertyOrder
import {JsonPropertyOrder} from 'dali';
@JsonPropertyOrder('description', 'title')
class Test {
}
@JsonIgnoreProperties
import {JsonIgnoreProperties} from 'dali';
@JsonIgnoreProperties('from', 'to')
class Test {
}
@JsonProperty
import {JsonProperty} from 'dali';
class Test {
@JsonProperty
title = "title";
}
@JsonIgnore
import {JsonIgnore} from 'dali';
@Json
class Test {
@JsonIgnore
from = new Date();
}
@Async
import {Async} from 'dali';
@Async
class MyTask {
execute(a, b) {
return a+ b;
}
}
var task = new MyTask();
task.execute(2, 2).then((result) => {
console.log(result);
});
More info and complete example in Seed project.
License
(The MIT License)
Copyright (c) 2015 Iván Rodríguez [email protected]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.