使用火焰UI组件sAlert流星1.2.1角 [英] Use Blaze UI Component sAlert in Meteor 1.2.1 with Angular

查看:135
本文介绍了使用火焰UI组件sAlert流星1.2.1角的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个工作流星应用与角度,不断开拓前的1.2.1更新出来了,但现在不能汇入作业不再可能使用例如:

I had a working Meteor App with Angular and Blaze before the 1.2.1 Update came out, but now it´s not possible anymore to use for example

{{>sAlert}}

在我的申请。

有一个叫帮手包的角度与 - 火焰,在这里你有可能包括火焰的模板,我想我倒是裹{{> sAlert}}成自定义模板,并加载它

There is a helper package called "angular-with-blaze", where you have the possibility to include Blaze templates, and I thought I´d wrap the {{>sAlert}} into a custom template, and load it with

<template name="custom">
    {{>sAlert}}
</template>
<blaze-template name="custom"></blaze-template>

但它告诉我,该模板wasn't找到。

But it tells me, that the template wasn´t found.

所以,现在是什么去包括基于角应用在我的流星这些组件的方式?

So what is now the way to go for including such components in my meteor based angular app?

推荐答案

您的做法是正确的。把sAlert模板帮手大火模板和渲染火焰模板该模板。但是,你需要把大火模板线在棱角分明的HTML文件,并在另一个HTML文件中,在你只有把你的火焰模板实际大火模板。

Your approach is correct. Put the sAlert template helper in a blaze template and render that template with blaze-template. But you need to put the blaze-template line in your angular html file and the actual Blaze template in another html file where you only put your Blaze templates.

例如-list.ng.html:

example-list.ng.html:

<div>
    <header>
        <h1>Sample</h1>
    </header>

    <blaze-template name="test1"></blaze-template>
    <blaze-template name="test2"></blaze-template>
</div>

和你的火焰模板另一个文件:
大火-templates.html:

And another file for your Blaze templates: blaze-templates.html:

<template name="test1">
    {{> sAlert}}
    Hello {{visitor}}
</template>

<template name="test2">
    Hello {{customer}}
</template>

*,因为我既渲染TEST1和TEST2到同一个页面,只测试1可以有sAlert模板帮手。如果在不同的页面,重复模板帮手。但是,这不是你的问题的一部分,它是sAlert如何工作的。

* because I render both test1 and test2 to the same page, only test1 can have the sAlert template helper. If on different pages, repeat the template helper. But that is not part of your question, it is how sAlert works.

这篇关于使用火焰UI组件sAlert流星1.2.1角的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆