feat(compiler): add TemplateCompiler

TemplateCompiler is the entry point to the new compiler

Related to #3605
Closes #4220
This commit is contained in:
Tobias Bosch
2015-09-14 15:59:09 -07:00
parent eaa20f661a
commit 457b689bf0
47 changed files with 2064 additions and 725 deletions

View File

@ -19,14 +19,14 @@ import {evalModule} from './eval_module';
// when evaling the test module!
export var TEST_VALUE = 23;
const THIS_MODULE = 'angular2/test/compiler/eval_module_spec';
export function main() {
describe('evalModule', () => {
it('should call the "run" function and allow to use imports',
inject([AsyncTestCompleter], (async) => {
var moduleSource = IS_DART ? testDartModule : testJsModule;
var imports = [['angular2/test/compiler/eval_module_spec', 'testMod']];
evalModule(moduleSource, imports, [1])
evalModule(moduleSource, [[THIS_MODULE, 'tst']], [1])
.then((value) => {
expect(value).toEqual([1, 23]);
async.done();
@ -36,15 +36,15 @@ export function main() {
}
var testDartModule = `
run(data) {
data.add(testMod.TEST_VALUE);
run(data) {
data.add(tst.TEST_VALUE);
return data;
}
`;
var testJsModule = `
exports.run = function(data) {
data.push(testMod.TEST_VALUE);
data.push(tst.TEST_VALUE);
return data;
}
`;