我怎么写玉器样式的HTML与角度的应用程序? [英] how do I write jade-style html with an angular app?

查看:95
本文介绍了我怎么写玉器样式的HTML与角度的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始写一个前preSS的应用程序和使用玉器为我的HTML真的很喜欢。现在我正在写一个角度应用程序,不想键入所有的<>我的HTML。我还没有决定对角应用后端。

I started writing an express app and really liked using Jade for my html. Now I'm writing an angular app and don't want to type all of the "<>" for my html. I haven't decided on a backend for the angular app.

我如何使用玉写一个角度应用程序的HTML?

How do I write the html for an angular app using jade?

编辑:

我做了一个的package.json ,其中包括:

I made a package.json and included:

"dependencies": {
"jade":"0.35.x"
}

然后跑 NPM安装

但是当我创建和打开 index.jade 不渲染HTML,POR阙?

But when I create and open index.jade it doesn't render html, por que?

推荐答案

在HAML可以使用自定义属性,如

In HAML you can use custom attributes like

%button{:"ng-click" => "myFunc()"} Click here

渲染

<button ng-click="myFunc()">Click here</button>

或 - 使用自定义的数据属性,这样

OR - use custom data attributes like this

%button{:data {:"ng-click" => "myFunc()"}} Click here

渲染

<button data-ng-click="myFunc()">Click here</button>

请参阅 http://haml.info/docs/yardoc/file.REFERENCE html的#html5_custom_data_attributes 对HTML5自定义数据的官方文档属性。

See http://haml.info/docs/yardoc/file.REFERENCE.html#html5_custom_data_attributes for the official docs on HTML5 Custom Data Attributes.

这篇关于我怎么写玉器样式的HTML与角度的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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