我正在尝试向多个收件人发送电子邮件.为此,我创建了一个收件人数组,但是使用我的代码,我只能将邮件发送到阵列的最后一次电子邮件ID三次.我的代码出了什么问题?
var nodemailer = require("nodemailer");
var smtpTransport = nodemailer.createTransport(
"SMTP",{
host: '',
// secureConnection: true, // use SSL
port: 25
});
var maillist = [
'****.sharma3@****.com',
'****.bussa@****.com',
'****.gawri@****.com',
];
var msg = {
from: "******", // sender address
subject: "Hello ?", // Subject line
text: "Hello This is an auto generated Email for testing from node please ignore it ?", // plaintext body
cc: "*******"
// html: "<b>Hello world ?</b>" // html body
}
maillist.forEach(function (to, i , array) { …
Run Code Online (Sandbox Code Playgroud) 我正在使用JSON数据来驱动一些使用javascript D3可视化工具(http://mbostock.github.com/d3/)制作的图表.我已经设置了我的WCF服务,这个代码在Jquery中运行正常:
$('#getDataItems').click(function () {
var $DataList = $('#DataList');
$DataList.empty().appendLi('Loading...');
// Get the JsonP data
$.getJSON('http://localhost:65025/CustomersService.svc/GetMyDataItems?callback=?', null, function (somedata) {
alert('Received ' + somedata.length + ' Items');
$DataList.empty();
$.each(somedata, function () {
$DataList.appendLi(this.ID + " - " + this.Value);
}); // end each dataitem function
}); // end success function
}); // end #getDataItems.click
Run Code Online (Sandbox Code Playgroud)
D3也有使用JSON数据的功能,但我还没有成功.它看起来像这样:
// this works
//var data = [4, 8, 15, 16, 23, 42];
// this doesn't
var data = function () {
d3.json('http://localhost:65025/CustomersService.svc/GetMyDataItems?callback=?',
function (data) } …
Run Code Online (Sandbox Code Playgroud) 我正在使用(ngImgCrop)裁剪图像,然后使用(angular-file-upload)将裁剪后的图像上传到服务器.
我可以从ngImgCrop中的"on-change"选项中获取$ dataURI.但我需要一个File instace来调用$ upload.如何获取裁剪图像的File实例以便上传:
$scope.upload = $upload.upload({
url: '/api/fileupload',
file: [**file cropped here**]
}).progress(function (evt) {
//
}).success(function (data, status, headers, config) {
//
});
Run Code Online (Sandbox Code Playgroud) 我想在我的角度2应用程序和其他角度1模块中使用角度1模块(角度智能表).有没有办法做到这一点?
文档展示了如何将角度1应用程序升级到角度2.我的所有外部库都会破坏吗?
在一个项目中,我将html文件转换为pdf,而不是工作正常.但是这个输出没有显示css design.Now我需要一个建议如何用这个pdf文件添加css设计?
这里是js函数代码:
$(function(){
var doc = new jsPDF();
var specialElementHandlers = {
'#editor': function (element, renderer) {
return true;
}
};
$('#cmd').click(function () {
doc.fromHTML($('#StudentInfoListTable').html(), 15, 15, {
'width': 170,
'elementHandlers': specialElementHandlers
});
doc.save('sample-file.pdf');
});
Run Code Online (Sandbox Code Playgroud)
我从这个项目https://github.com/MrRio/jsPDF获得了帮助
这是我的表
这是pdf输出
我试图添加一个表
$('#cmd').click(function () {
var table = tableToJson($('#StudentInfoListTable').get(0))
var doc = new jsPDF('p', pt, 'a1', true);
doc.cellInitialize();
$.each(table, function (i, row){
console.debug(row);
$.each(row, function (j, cell){
doc.cell(10, 50,120, 50, cell, i); // 2nd parameter=top margin,1st=left margin 3rd=row cell width …
Run Code Online (Sandbox Code Playgroud) 我有一种情况,我正在使用angularJs智能表进行过滤。
的HTML:
<section class="main" ng-init="listAllWorkOrderData()">
<table st-table="listWorkOrderResponse">
<thead>
<tr>
<th st-sort="id">ID <i></i></th>
<th st-sort="project">Project <i></i></th>
</tr>
</thead>
<tbody ng-repeat="workOrder in listWorkOrderResponse">
<tr>
<td>{{workOrder.id}}</td>
<td>{{workOrder.project}}</td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
</section>
Run Code Online (Sandbox Code Playgroud)
我正在测试2种不同的情况。
在我的控制器中,我首先调用相同的函数,但发送虚拟数组,在第二种情况下,我发送从api调用接收的数组。
1. Dummy data
$scope.listAllWorkOrderData = function () {
var listWorkOrderResponse = [{"id":"1","project":"project1"},{"id":2,"project":"project2"},{"id":"3","project":"project3"}];
}
2. I am using a service and fetching data through api.
$scope.listAllWorkOrderData = function () {
TestService.listAllWorkOrderData().then(function (response, status, headers, config) {
if (response != undefined && response != null) {
if (!$scope.listWorkOrderResponse) { …
Run Code Online (Sandbox Code Playgroud) 出于某种原因,我的分页总是重置为1作为所选页面,即使结果从服务器返回,结果EG记录31-45中的正确数据)并在智能表中正确填充.是什么原因导致它始终将分页视图中的选定页面重置为第1页?有没有办法说出所选页面是什么?
提前致谢
控制器方法
$scope.getData = function (tableState) {
var pagination = tableState.pagination;
var start = pagination.start || 0;
var number = pagination.number || 10;
$scope.users = UserServicePaging.query({offset: start});
$scope.users.$promise
.then (function (result) { //success
$scope.users = result[0].results;
$scope.rowCollection = $scope.users;
$scope.displayedCollection = [].concat($scope.rowCollection);
tableState.pagination.numberOfPages = Math.ceil(parseInt(result[0].records.total)) / 15;
tableState.pagination.totalItemCount = Math.ceil(parseInt(result[0].records.total));
},
function (error) {//fail
})
.finally(function() {
});
}
Run Code Online (Sandbox Code Playgroud)
表头:
<table st-table="displayedCollection" st-safe-src="rowCollection" st-pipe="getData" class="table table-striped">
Run Code Online (Sandbox Code Playgroud)
表页脚
<td colspan="5" class="text-center">
<div st-pagination="" st-items-by-page="itemsByPage" st-displayed-pages="10"></div>
</td>
Run Code Online (Sandbox Code Playgroud) 我正在使用Angular 翻译进行开发。我想知道是否有一个全局配置可以一次性绑定翻译。
我期待的东西
$translateProvider.enableOneTimeBinding(true);
Run Code Online (Sandbox Code Playgroud) https://gist.github.com/anonymous/ba82f74071cc38a0700b
在更改某些设置(例如主机和端口)之前,它在本地可以正常工作,但不能在生产环境中使用。
有人知道为什么吗?
谢谢
我实现了文件上传。前端代码取自流行教程。我在服务中发送 POST:
myApp.service('fileUpload', ['$http', function ($http) {
this.uploadFileToUrl = function(file, uploadUrl){
var fd = new FormData();
fd.append('file', file);
$http.post(uploadUrl, fd, {
transformRequest: angular.identity,
headers: {'Content-Type': undefined}
})
.success(function(){
})
.error(function(){
});
}
}]);
Run Code Online (Sandbox Code Playgroud)
后端典型的multer用法:
exports.postFile = function (req, res) {
var storage = multer.diskStorage({ //multers disk storage settings
destination: function (req, file, cb) {
cb(null, '../documents/')
},
filename: function (req, file, cb) {
cb(null, file.originalname)
}
});
var upload = multer({ //multer settings
storage: storage
}).single('file');
upload(req, …
Run Code Online (Sandbox Code Playgroud) angularjs ×6
javascript ×5
node.js ×2
nodemailer ×2
smart-table ×2
angular ×1
crop ×1
css ×1
d3.js ×1
express ×1
file-upload ×1
html ×1
json ×1
jsonp ×1
jspdf ×1
libraries ×1
multer ×1
pagination ×1
pdf ×1
wcf ×1