引题 用过node的同学应该都知道require是用来加载模块的,那你是否存在如下的疑问呢?1. require(path)是如何依据path找到对应module呢?2. 为何在模块定义中,一定要通过module.exports暴漏出接口?module.exports与require存在什么关...
分类:
其他好文 时间:
2014-12-19 20:41:29
阅读次数:
164
页面的引用 页面页脚footer.ftl引用: app.jsdefine(function(require, exports, module) { window.$ = window.jQuery = require('jquery'); require('placehol...
分类:
Web程序 时间:
2014-12-19 18:59:09
阅读次数:
268
Directive can use another directive though 'require' keyword.angular.module('docsTabsExample', []).directive('myTabs', function() { return { restr...
分类:
Web程序 时间:
2014-12-19 07:02:29
阅读次数:
582
首先安装依赖库node-xlsxnpm installnode-xlsx在操作文件中直接引用var xlsx = require("node-xlsx");读取excelvar list =xlsx.parse("./excel/" + excelName);//读出后是数组,包含每个sheet[ ...
分类:
Web程序 时间:
2014-12-18 13:21:34
阅读次数:
166
转载:https://cnodejs.org/topic/53787247cbcc396349fe3f5anpm install express --savenpm install socket.io --savechat.jsvar express = require('express');var...
分类:
Web程序 时间:
2014-12-18 10:17:39
阅读次数:
263
1 // 加载http服务包 2 var http = require("http"); 3 4 // 创建服务 5 var server = http.createServer(requestListener); 6 7 // 监听端口 8 server.listen(7798); 9 10...
分类:
Web程序 时间:
2014-12-18 00:03:27
阅读次数:
201
需要用lua写一个工具,c++调用lua,然后这个lua要require其他lua脚本,在主lua里面设置package.path,但一直都失败,甚至lua都无法编译通过。project_path = cpp_getProjectPath()local path = project_path.."/...
分类:
其他好文 时间:
2014-12-17 17:53:07
阅读次数:
722
/** ?* main external API structure. ?* New fields can be added to the end with minor version bumps. ?* Removal, reordering and changes to existing fields require a major ?* version bump. ?* P...
分类:
其他好文 时间:
2014-12-17 16:37:55
阅读次数:
1015
首先准备一个要包含的文件a.php,文件内容如下测试require_once,内容如下<?phpfor($i=1; $i<=10;$i++) { require_once('a.php'); echo $a++;}输出结果如下,因为只有第一次包含有效,以后的包含就都无效了1234567...
分类:
其他好文 时间:
2014-12-17 01:27:21
阅读次数:
236
--[[
lua元表完成
数值和逻辑运算
]]
--[[
Lua不支持函数默认值
所以通过是否为nil来判断
如果是nil的话,not nil为true
Lua支持的元表函数
__add 加
__sub 减
__div 除
__unm 负
__pow 幂
Lua支持的元表逻辑运算
__eq 等于
__lt 小于
__le 小于等于
]]
require("math")
functio...
分类:
其他好文 时间:
2014-12-17 00:22:01
阅读次数:
133