我读了很多教程,但我不知道怎么做,这是输入
input(type="text",name="price",id="price"data-bind="text: price,valueUpdate:['afterkeydown','propertychange','input']")
Run Code Online (Sandbox Code Playgroud)
这是我的viewModel
price: ko.computed(function()
{
return parseFloat(this.replace(' ','').replace(/[^0-9\.]+/g,"")) || '';
},this)
Run Code Online (Sandbox Code Playgroud)
但这导致错误:这没有方法替换??? 我怎样才能将价格值传递给计算函数?
最近,我一直在寻找有关流星和德比的信息,并且没有找到太多关于除了我想与你分享的优秀德比文章.除此之外,我对这两个项目都非常非常感兴趣.我会选择其中一个来测试它们的有效性,速度和效率,现在我担心的是我想在客户端上实现jquery和bootstrap以及服务器上的jade,nib手写笔.我想知道哪一个更快.从我在文章中读到的内容中我了解德比更好,更快,更兼容SEO.但是我想知道你对这两个项目有什么看法.
我还读到流星有一个更大的社区,并且在项目上投入了大量资金,因此他们得到了更多的支持.
现在我只想知道今天最好的选择.
非常感谢大家,我希望能够接触到项目的创建者,以便他们可以查看jade stylus nib,jquery和bootstrap模块的实现,以实现响应式设计.
PS:我想留下一个重要的澄清,现在我最大的优势是表达nodejs和npm轻松允许我安装任何电动工具并在我的项目中实现它.
我正在尝试Mongo Atlas Cloud.我创建一个集群,我正在尝试与mongo shell连接:(与mongo驱动程序相同的问题)
mongo mongodb://***-cluster-shard-00-00-***.mongodb.net:27017,***-cluster-shard-00-01-***.mongodb.net:27017,***-cluster-shard-00-02-***.mongodb.net:27017/any_database?replicaSet=****-Cluster-shard-0 --ssl --username ***** --password *****
Run Code Online (Sandbox Code Playgroud)
这是文档中的连接字符串.这是错误:
MongoDB shell version: 3.2.7
connecting to: mongodb://***-cluster-shard-00-00-***.mongodb.net:27017,***-cluster-shard-00-01-***.mongodb.net:27017,***-cluster-shard-00-02-***.mongodb.net:27017/any_database?replicaSet=***-Cluster-shard-0
2016-07-07T01:31:17.535-0300 I NETWORK [thread1] Starting new replica set monitor for ***-Cluster-shard-0/***-cluster-shard-00-00-***.mongodb.net:27017,***-cluster-shard-00-01-***.mongodb.net:27017,***-cluster-shard-00-02-***.mongodb.net:27017
2016-07-07T01:31:17.535-0300 I NETWORK [ReplicaSetMonitorWatcher] starting
2016-07-07T01:31:20.084-0300 E QUERY [thread1] Error: Authentication failed. :
DB.prototype._authOrThrow@src/mongo/shell/db.js:1441:20
@(auth):6:1
@(auth):1:2
exception: login failed
Run Code Online (Sandbox Code Playgroud)
我只能在使用管理员数据库"/ admin?"时连接到数据库.在连接字符串中.
问题:
我需要使用控制台或mongo驱动程序连接到自定义数据库.
PD:用"***"保护我的数据
我需要这个 
这是控制器代码:
$scope.sideNavMenu =
{
title: "User Manual",
subMenu: [
{
title: "Title one",
link: "index/titleone.html",
icon:"fa fa-caret-down",
subMenu: []
},
{
title: "Basic",
link: "index/basic/basic.html",
icon:"fa fa-caret-down",
subMenu: [
{
title: "Basic Function",
link: "index/basic/function.html",
icon:"fa fa-caret-down",
subMenu: []
}]
}]
};
Run Code Online (Sandbox Code Playgroud)
我已经有两个星期的时间试图解决了.请任何可以帮助我?
就这一点而言
<div id="MainMenu">
<div class="list-group panel">
<a href="#mainMenuContainer" class="list-group-item list-group-item-success strong" data-toggle="collapse" data-parent="#MainMenu">
<i class="fa fa-home"></i>
{{sideNavMenu.title}}
<i class="fa fa-caret-down"></i>
</a>
<div ng-include ng-if="sideNavMenu.subMenu.length > 0" ng-repeat="navMenu in sideNavMenu.subMenu" onload="data = navMenu" src="'menuTemplate.html'"class="collapse" id="mainMenuContainer">
</div>
</div> …Run Code Online (Sandbox Code Playgroud) 我无法弄清楚问题是什么
div#wrapper(ng-app="adminApp")
....
Run Code Online (Sandbox Code Playgroud)
JS /
var adminApp = angular.module('adminApp', ['ui-router']);
Run Code Online (Sandbox Code Playgroud)
如果我使用
var adminApp = angular.module('adminApp', []);
Run Code Online (Sandbox Code Playgroud)
错误消失了
这是为什么?
更新:
从控制台添加图像

我家里有一台带静态IP的服务器,我用域名提供自己的网页,一切正常.
在我的网页中,您可以通过电子邮件和密码注册.当您注册名为nodemailer的节点模块时,从谷歌帐户发送电子邮件,问题是谷歌帐户有发送电子邮件的限制.
所以我需要将nodemailer模块连接到我自己家中的服务器.
我在谷歌搜索,但没有类似的答案.
如何在nodejs中使用postfix?
或者如何将haraka模块与nodemailer一起使用
https://github.com/baudehlo/Haraka
所以我重复我的问题,我需要从我的服务器发送一封电子邮件给任何在我的网站上注册的电子邮件用户.
例如...
用户jose@gmail.com在我的网站上注册
nodemailer配置是......
exports.newRegistration=function(parametros,callback)
{
var mailOptions =
{
from: "<myemailingoogle@gmail.com>",//my email
to: parametros.useremail,//user email
subject: 'Welcome '+parametros.useremail+'.',
html: '<br><b>Hello</b><br>'+ // html
};
var smtpTransport = nodemailer.createTransport("SMTP",
{
service: "Gmail",
secureConnection: true,
auth:
{
user: "myemailingoogle@gmail.com",
pass: "7ftera359c28a",
},
});
smtpTransport.sendMail(mailOptions, function(err, response)
{
if(err)
{
smtpTransport.close();
console.warn(err);
return callback(err,null);
}else{
smtpTransport.close();
return callback(null,response);
}
});
}
Run Code Online (Sandbox Code Playgroud)
电子邮件发送正常,但每天都有限制.
所以我需要使用电子邮件服务器发送我的电子邮件没有限制.... tnx
编辑2
我用apt-get安装mailutils
现在我试试
mail mymailin@gmail.com
Cc: // press enter
Subject: Welcome …Run Code Online (Sandbox Code Playgroud) 任何人都有一个快速的例子,使用mongoose和nodejs express在mongodb中插入图像
我读了一些例子,但我不明白怎么做?
我想在表单中上传图片
app.post('/videos/new', function(req, res) {
req.form.complete(function(err, fields, files) {
console.log('here i go');
if(err) {
next(err);
} else {
ins = fs.createReadStream(files.file.path);
console.log('insssssssssssss'+ins);
ous = fs.createWriteStream(__dirname + '/static/uploads/videos/' + files.file.filename);
util.pump(ins, ous, function(err) {
if(err) {
next(err);
} else { RegProvider.save({
file: req.param(files.file.filename),
filename: req.param('filename')
}, function(error, docs) {
res.redirect('/videos');
});
}
});
//console.log('\nUploaded %s to %s', files.file.filename, files.file.path);
//res.send('Uploaded ' + files.file.filename + ' to ' + files.file.path);
}
});
});
Run Code Online (Sandbox Code Playgroud)
像这个例子,但我不明白它是如何工作的
我在公共/ images/picture.jpg中显示带有玉的图片,但我想保护一些图片或限制访问公共文件夹怎么做?
project
node_modules
public
images
image.jpg
javascripts
stylesheets
protected_folder*
image_protected.jpg
views
Run Code Online (Sandbox Code Playgroud) 这是我的应用配置
app.js
//SERVER
var server = app.listen(3000, function(){
console.log("Express server listening on port %d in %s mode", app.get('port'),
app.settings.env);
});
//SOCKET.IO
var io = require('./socket.io').listen(server)
Run Code Online (Sandbox Code Playgroud)
/ socketio
var socketio = require('socket.io')
module.exports.listen = function(app)
{
io = socketio.listen(app);
io.configure('development',function()
{
//io.set('transports', ['websocket', 'xhr-polling']);
//io.enable('log');
});
io.configure('production',function()
{
io.enable('browser client minification'); // send minified client
io.enable('browser client etag'); // apply etag caching logic based on version number
io.set('log level', 1); // reduce logging
io.set('transports', [ // enable all transports (optional if …Run Code Online (Sandbox Code Playgroud) 我想将一组对象从mongodb传递给客户端...
这是对象
var objeto_img=
{
name:'name of the file',
image:'image.jpg url',
title:'title of the image',
caption:'descripcion of the image',
link:"#",
};
Run Code Online (Sandbox Code Playgroud)
在一些配置文件中有很多图像,所以这是一个像这样的对象数组
[var objeto_img=
{
name:'name of the file',
image:'image.jpg url',
title:'title of the image',
caption:'descripcion of the image',
link:"#",
},var objeto_img=
{
name:'name of the file',
image:'image.jpg url',
title:'title of the image',
caption:'descripcion of the image',
link:"#",
},var objeto_img=
{
name:'name of the file',
image:'image.jpg url',
title:'title of the image',
caption:'descripcion of the image',
link:"#",
};]
Run Code Online (Sandbox Code Playgroud)
这是服务器代码
res.render('index/perfil_publicacion_contenido',
{ …Run Code Online (Sandbox Code Playgroud) javascript ×7
node.js ×7
express ×4
angularjs ×2
mongodb ×2
mongoose ×2
pug ×2
derbyjs ×1
jquery ×1
knockout-2.0 ×1
knockout.js ×1
meteor ×1
nodemailer ×1
postfix-mta ×1
smtp ×1
socket.io ×1