玉混入在AngularJS [英] Jade Mixins in AngularJS

查看:160
本文介绍了玉混入在AngularJS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我想实现我的AngularJS项目玉模板,并在我的模板混入(可重复使用code)。

Hi I would like to implement Jade templates in my AngularJS project, and have mixin in my template (reusable code).

不过,我面临的问题是,我们不能带参数使用混入。我在做正确或者是有在AngularJS为同任何替代,我很想念?

However the problem that I am facing is that we cannot use Mixin with arguments. Am I doing it correctly or is there any alternative for the same in AngularJS that I am missing?

推荐答案

我想通了,混入不能在角被用作范围被定义。因此,现在创建的元素指令,并在模板(这是意味着混入写入)通过为templateUrl在里面。

I figured out that mixins cannot be used in Angular as the scope is to be defined. Hence now created element directive and passed in the template (which was meant to be written in Mixin) as the templateUrl in it.

这篇关于玉混入在AngularJS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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