Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(all): update to work with latest TemplatingEngine
  • Loading branch information
EisenbergEffect committed Oct 27, 2015
1 parent c59cf24 commit edf2b5f
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/aurelia.js
Expand Up @@ -3,7 +3,7 @@ import 'core-js';
import * as TheLogManager from 'aurelia-logging';
import {Container} from 'aurelia-dependency-injection';
import {Loader} from 'aurelia-loader';
import {BindingLanguage, ViewEngine, ViewSlot, ViewResources, CompositionEngine, Animator} from 'aurelia-templating';
import {BindingLanguage, ViewSlot, ViewResources, TemplatingEngine} from 'aurelia-templating';
import {DOM, PLATFORM} from 'aurelia-pal';
import {FrameworkConfiguration} from './framework-configuration';

Expand Down Expand Up @@ -81,10 +81,6 @@ export class Aurelia {
throw new Error(message);
}

if (!this.container.hasResolver(Animator)) {
Animator.configureDefault(this.container);
}

this.logger.info('Aurelia Started');
let evt = DOM.createCustomEvent('aurelia-started', { bubbles: true, cancelable: true });
DOM.dispatchEvent(evt);
Expand All @@ -102,8 +98,8 @@ export class Aurelia {
this._configureHost(applicationHost);

return new Promise(resolve => {
let viewEngine = this.container.get(ViewEngine);
this.root = viewEngine.enhance(this.container, this.host, this.resources, bindingContext);
let engine = this.container.get(TemplatingEngine);
this.root = engine.enhance({container: this.container, element: this.host, resources: this.resources, bindingContext: bindingContext});
this.root.attached();
this._onAureliaComposed();
return this;
Expand All @@ -117,18 +113,18 @@ export class Aurelia {
* @return Returns a Promise of the current Aurelia instance.
*/
setRoot(root: string = 'app', applicationHost: string | Element = null): Promise<Aurelia> {
let compositionEngine;
let engine;
let instruction = {};

this._configureHost(applicationHost);

compositionEngine = this.container.get(CompositionEngine);
engine = this.container.get(TemplatingEngine);
instruction.viewModel = root;
instruction.container = instruction.childContainer = this.container;
instruction.viewSlot = this.hostSlot;
instruction.host = this.host;

return compositionEngine.compose(instruction).then(r => {
return engine.compose(instruction).then(r => {
this.root = r;
instruction.viewSlot.attached();
this._onAureliaComposed();
Expand Down

0 comments on commit edf2b5f

Please sign in to comment.