简体   繁体   English

只使用Angular.js模板,没有整个框架?

[英]Using just Angular.js templates, without the whole framework?

Is it possible to compile Angular.js templates ( ng-show , ng-if , etc) into standalone functions which accept an object and return HTML? 是否可以将Angular.js模板( ng-showng-if等)编译成接受对象并返回HTML的独立函数? Like other templating languages like Handlebars, Underscore.js Templates? 像其他模板语言一样,如Handlebars,Underscore.js模板?

I would like to use the same template in other apps which don't use Angular.js 我想在其他不使用Angular.js的应用程序中使用相同的模板

Those templates are called Directives. 这些模板称为指令。 Directives are a core part of Angularjs and can only be used in the context of Angularjs. 指令是Angularjs的核心部分,只能在Angularjs的上下文中使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM