The Future
of Angular
Miško Hevery
misko@hevery.com
http://goo.gl/8oqVDn
Goal
Make world better through technology
Disclaimer
Agenda
Browsers
Support
Browsers
Standards
Web Components
Standards
Web Components
Standards
Object.observe
Standards
DOM Mutation Observers
Standards
Polyfill
Standards
Polyfill
Standards
Community
Current State
Community
Break it up
Community
Reuse
Community
Ideas�(the crazy kind)
Asynchronous DI
Ideas
GOAL
Make lazy loading of code easy
Asynchronous DI
Ideas
Asynchronous DI
Ideas
module {
size: 5,
users: Future<XHR> ...,
storage: Future<Code>
}
class App(size, users, storage) {
…
}
Zone
Ideas
GOAL�
Remove $apply/$digest�Use existing libraries in Angular
Make stack traces sane
Zone
Ideas
future1 =xhr.get(url).then(fn);
var ngZone = new AngularZone();
ngZone.run(function(){
future2 = xhr.get(url).then(fn);
});
Zone
Ideas
Zone
Ideas
ES6
Ideas
ES6
Ideas
class MyApp {
constructor(size, users, storage) {
...
}
}
ES6 & Annotations
Ideas
@NgDirective({
selector: '[ng-bind]',
map: {'ng-bind': '@ngBind'} })
class NgBindDirective {
@Inject([Element])
constructor(element) { … }
set ngBind(value) { element.text=value; }
}
ES6 & Types???
Ideas
@NgDirective({
selector: ['ng-bind'],
map: {'ng-bind': '@ngBind'} })
class NgBindDirective {
constructor(element:Element) { … }
set ngBind(value) { element.text=value; }
}
ES6 & Types???
Ideas
function NgBindDirective(element)…;
NgBindDirective.__annotation__ = {
type: new NgDirective(...)
arguments: [{type:Element}]
}
ES6 & Contracts
Ideas
ES6 & Contracts
Ideas
ES6 & Contracts
Ideas
ES6 & Contracts
Ideas
var a = …;
String b = 'foo';
JQuery c = $('#foo');
RegExp d = '/some\s+(regexp?)/';
List<CSS> = ['.foo', 'a[b]'];
ES6 & Contracts
Ideas
class MyController {
constructor(e:Element, s:CSS) {
JQuery b = $(e.find(s);
}
}
ES6 & Contracts
Ideas
ES6.next???
Ideas
Questions?
Fin