当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript exports.renderer_renderAsync函数代码示例

本文整理汇总了TypeScript中@core/renderer/exports.renderer_renderAsync函数的典型用法代码示例。如果您正苦于以下问题:TypeScript renderer_renderAsync函数的具体用法?TypeScript renderer_renderAsync怎么用?TypeScript renderer_renderAsync使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了renderer_renderAsync函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: function

    constructor: function(name, expression, nodes, model, ctx?, container?, ctr?) {
        this.onComplete = this.onComplete.bind(this);
        this.anchor = document.createComment('');
        container.appendChild(this.anchor);

        var node = {
            type: Dom.NODE,
            tagName: name,
            nodes: nodes,
            expression: expression,
            attr: {},
        };			
        renderer_renderAsync(node, model, (builder_Ctx as any).clone(ctx), null, ctr)
            .then(
                this.onComplete,
                this.rejectDelegate()
            );
    },
开发者ID:atmajs,项目名称:MaskJS,代码行数:18,代码来源:await.ts

示例2: mask_config

		};

		mask_config('getScript', async path => {
			return new Foo();
		});


		var template = `
			import * as IFoo from 'Foo.js';

			define FooCompo  {
				function constructor (foo: IFoo) {
                    this.foo = foo;
				}
				function onRenderStart () {
                    this.emitOut('fooSignal', this.foo.load());	
				}
			}

			FooCompo;
		`;

		return renderer_renderAsync(template, null, null, null, {
			slots: {
				fooSignal: assert.await(function(sender, str){
					eq_(str, 'Hello');
				})
			}
		});
	}
})
开发者ID:atmajs,项目名称:MaskJS,代码行数:31,代码来源:di.spec.ts

示例3: UTest

UTest({
	$before () {
		// use default module loader
		mask_config('modules', 'default');
		Module.cfg('moduleResolution', 'node');
	},
	$after () {
        Module.cfg('moduleResolution', 'classic');
        listeners_off('error');
	},

	async 'should load default file in node_modules' () {
		let dom = await renderer_renderAsync(`
            import Foo from '/test/tmpl/npm/foo.mask';

            Foo;
        `);
        
        return UTest.domtest(dom, `
            find ('h4') > text ('EmptyPackage');
        `);
	},
	async 'should fail loading' () {
        var errors = [];
        
		listeners_on('error', assert.await((error) => errors.push(error)));
		await renderer_renderAsync(`
            import Any from '/test/tmpl/npm/foo-none.mask';
            Any;
        `);
开发者ID:atmajs,项目名称:MaskJS,代码行数:30,代码来源:npm.spec.ts

示例4: is_

                var name = path.substring(path.lastIndexOf('/') + 1);

                _queue.push(name);
                
                var str = Files[name];
                is_(str, 'String');
                if (name === 'MyComponents.mask') {
                    setTimeout(() => resolve(str), 200);
                    return;
                }
                resolve(str);
            });
		});

		let dom = await renderer_renderAsync(`
			import sync from './MyComponents';
			import './MyLetter';
		`);
		
		mask_config('getFile', null);
		deepEq_(_queue, ['MyComponents.mask', 'MyLetter.mask']);

		await UTest.domtest(dom, `
			find ('h1') > text ('B');
		`);	
	},
	'should load async javascripts scope' (done) {
		customTag_define('TestAsync', Compo.create({
			onRenderStart () {
				var x = this.$scope('X');
				eq_(x, null, 'Scope should be empty, while still loading');
开发者ID:atmajs,项目名称:MaskJS,代码行数:31,代码来源:async.spec.ts

示例5: name

	async 'should load script' () {
		var Foo = {
			get name () { return 'FooTest' }
		};

		Module
			.cfg('prefixes.services', '/src/services/{0}.js')
			.cfg('ext.script', 'js')
			;
		mask_config('getScript', assert.await(async path => {
			has_(path, '/src/services/FooService.js');			
			return Foo;
		}));
		let dom = await renderer_renderAsync(`
            import * as Foo from '@services/FooService';
            h3 > '~[Foo.name]'
        `);
			
        return UTest.domtest(dom, `
            find('h3') > text FooTest;
        `);

	},
	async 'should load mask' () {
        
        Module.cfg('prefixes.controls', '/src/compos/controls/{0}/{0}.mask');
            
		mask_config('getFile', assert.await(async path => {
			has_(path, '/src/compos/controls/OkButton/OkButton.mask');

			return `
开发者ID:atmajs,项目名称:MaskJS,代码行数:31,代码来源:prefixes.spec.ts

示例6: UTest

import { Module } from '@core/feature/modules/exports';

UTest({
	$teardown () {
		mask_config('getFile', null);
		mask_config('getScript', null);
	},

	async 'should load mask' () {
		mask_config('getFile', assert.await(async path => {
			has_(path, 'controls/Foo.mask');
			var template = 'define Foo { h3 > "FooTest" }';
			return template;
		}));
		let dom = await renderer_renderAsync(`
            import Foo from controls is mask;
            Foo;
        `);
			
        return UTest.domtest(dom, `
            find('h3') > text FooTest;
        `);
	},
	async 'should load script' () {
		Module.cfg('ext.script', 'es6');
		mask_config('getScript', assert.await(async path => {
			has_(path, 'services/Foo.es6');

			var service = {
				getName () { return 'FooServiceTest' }
			};
			return service;
开发者ID:atmajs,项目名称:MaskJS,代码行数:32,代码来源:ns.spec.ts

示例7: checkIt

		Module.clearCache();
	},
	async 'should get instance from define args' () {
		class Foo {
			checkIt () { return 'checkThis' }
		};

		mask_config('getScript', async path => {
			return new Foo()
		});

		var template = `
			import * as Foo from 'Foo.js';
			section > Foo > span > '~[this.checkIt()]'
		`;
		var dom = await renderer_renderAsync(template);

		return UTest.domtest(dom, `
			find ('span') > text ('checkThis');
		`)
	},
	async 'should get mask component in js' () {
		
		mask_config('getFile', async path => {
			has_(path, /Any\.mask/);
			let template = `
				define MyFoo {
					function baz () {}
				}
			`;
			return template;
开发者ID:atmajs,项目名称:MaskJS,代码行数:31,代码来源:js-compo.spec.ts

示例8: mask_config

		});
	},
	async 'check preprocessor' () {
		mask_config('preprocessor.style', function(body){
			return body.replace('red', 'green');
		});
		var template = `
			div {
				style scoped {
					:host {
						background: red;
					}
				}
			}
		`;
		let div = await renderer_renderAsync(template);
			
        var str = $('body').children('style').last().text();
        hasNot_(str, 'red');
        has_   (str, 'green');

        mask_config('preprocessor.style', null);
    
	},
	'check serialization': {
		'simple' () {
			var tmpl = `
				section {
					style {
						body {
							border: ~[width]px;
开发者ID:atmajs,项目名称:MaskJS,代码行数:31,代码来源:style.spec.ts


注:本文中的@core/renderer/exports.renderer_renderAsync函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。