RequireJS`!`语法 - 它是什么?

时间:2017-07-05 09:37:08

标签: javascript angular requirejs

我是JS的新手。这是我们申请的define([ 'angular', 'underscore', 'text!./ItemsList.html', 'less!./ItemsList', ] 部分:

text!.

less!."//*[@id='add_to_cart_form']/div[2]/div[2]/a/span[1]/span[1]"有什么意义?这是某种预处理吗?

1 个答案:

答案 0 :(得分:1)

似乎text!模块定义。此less!json!是负责导入文件的模块的定义。有很多模块,比如.js来加载特定类型的文件(通常是自定义模块加载LOAD CSV WITH HEADERS FROM 'file:///hwconnectIDs.csv' AS cnct MATCH (h1:hardware), (h2:hardware), (c:cable) WHERE (h1.hwID= cnct.conID1) AND (h2.hwID = cnct.conID2) AND (c.cableID =cnct.cableID) FOREACH ( plugType IN CASE WHEN (h1.plug1=c.plug1 AND c.plug2=h2.plug1) THEN [c.plug1,c.plug2] CASE WHEN (h1.plug2=c.plug2 AND c.plug1=h2.plug1) THEN [c.plug2,c.plug1] ELSE [] END | CREATE (h1)<-[:connect{plug:plugType[0]}]-(c)-[:connect{plug:plugType[1]}]->(h2) ) 文件)

查看requirejs文本documentation