Tag: angularjs

AngularJS:检索存储在$ templateCache中的video模板结果404错误

我目前在我的本地主机上开发了一个AngularJS 1.5.9 单页面应用程序 ,并在其中使用了运行后端的NodeJS video框架。 http://www.videogular.com/ 除了在我的页面上插入video对象,一切都很好。 我严格按照给定的例子: http : //www.videogular.com/examples/simplest-videogular-player/ <videogular vg-theme="controller.config.theme.url"> <vg-media vg-src="controller.config.sources" vg-tracks="controller.config.tracks" vg-native-controls="true"> </vg-media> </videogular> 但是它会导致AngularJS错误: (请求中的sessionId是没有链接到当前问题的身份validation令牌) 我在videogular.jsfind了以下videogular.js : $templateCache.put("vg-templates/vg-media-video", "<video></video>"); $templateCache.put("vg-templates/vg-media-audio", "<audio></audio>"); 我试图在本地存储文件,并且错误消失了 实际上有很多的video插件,他们都使用$templateCache存储caching中的一些文件,所以手动将它们本地保存在我的应用程序文件夹将是非常混乱。 这样的文件如何使用$templateCache存储在caching中,这样可以正确提取它们? 我赞赏你的帮助。 UPDATE 我已经尝试插入$templateCache.get指令,其中部分加载错误404,它的工作原理。 但仍不能如预期那样工作。

使用注入时,ng-file-upload不能与MEAN.JS应用程序一起使用

引发错误: angular.js:13920 Error: [$injector:unpr] Unknown provider: ngFileUploadProvider <- ngFileUpload <- MyCtrl http://errors.angularjs.org/1.5.8/$injector/unpr?p0=ngFileUploadProvider%20%3C-%20ngFileUpload%20%3C-%20MyCtrl at http://192.168.99.100:3000/lib/angular/angular.js:68:12 at http://192.168.99.100:3000/lib/angular/angular.js:4511:19 at Object.getService [as get] 当控制器定义如下: (function ($, angular) { 'use strict'; angular.module('myapp').controller('MyCtrl', MyCtrl); function MyCtrl( $scope, $q, $stateParams, Upload, $timeout ){ var vm = this; function setup(){ vm.stateParams = $stateParams; //set scope variables here viewApi(); } function viewApi(){ vm.uploadImage […]

如何从angularjs访问variablesexpression式

第一 exports.render = function(req,res){ res.render('index', { title: 'welcome', username : req.user ? req.user :'' }); }; 我想导出要使用的对象 req.user h2 Hello #{username.username} h2 Hello #{username} 在翡翠我可以使用它 div(ng-app='IndexController') {{ #{username} | getUserData }} 但是如果我想要得到它的angular度,它不能使用 mainAppModule.filter('getUserData', function () { return function (name) { if (name) console.log(name.username + "xxxxxxxxxxxxxxxxxxxxxxxxqqqqqqqqqq"); return 'Hellox, '; }; }); 我该怎么做? 如何获得req.user以供req.user使用。如果有其他方法可以让angular色使用对象请告诉我。 非常感谢。

angular2-webpack-starter如何将NodeJS服务器添加到项目中

我克隆了angular2-webpack-starter项目,效果很好; 现在我想添加一个单独的NodeJS服务器到这个项目(我需要嘲笑一些数据与NodeJS为后端),但不知道如何以及从哪里开始,有人可以帮忙吗?

设置angular度js应用程序index.html页面只包含单一的控制器

我已经在后端使用nodejs编写了angular度应用程序(MEAN)。 在应用程序中有多个模块,所以有多个控制器。 我们必须在index.html文件中包含所有的控制器,如果我们在任何模块中添加了新的控制器。 我检查了在同一个堆栈(MEAN)上运行的其他应用程序,但在那里我没有find所有的控制器的源代码。 所以请大家帮助我优化我的应用程序。

IBM推送:不能在ibmpush.js中使用sendNotificationByDeviceIds

我有一个应用程序,并使用函数sendNotificationByDeviceIds如下: PushNotificationToConsumer: function(req, res) { queryCustomer.find({jpay_no : jpay_no}).done(function(customerReturn){ if(customerReturn.length > 0){ var device_id = customerReturn[0].attributes.device_id.toString(); req.ibmpush.sendNotificationByDeviceIds(message, [device_id], null).then(function(response){ res.json({success : true, message : 'Send notification to patient with device_id:' +device_id+ ' successful ' }); },function(err){ res.json(err); }); }else{ } }, function(err){ res.json(err); }) } 错误消息: 在app.js上:我声明了ibmpush = require('ibmpush') 请帮助给我你的想法。 谢谢

当页面加载时,自动点击button,如ifarme

如果我想在ifarme中自动点击一个button元素,我将如何去做这个工作? function autoclick() { document.getElementById('u_0_4').contentWindow.document.getElementById("u_0_5").click() } <div onload="autoclick()" > <iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fweb.facebook.com%2FMaherZain&width=450&layout=standard&action=like&size=small&show_faces=true&share=true&height=80&appId=788255487990117" width="450" height="80" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true" id="u_0_4" ></iframe> </div> =====>如果有任何其他方式做的,请告诉我:(

IBM PushNotification:Not Found – 目标资源“PushDevice”不存在

我尝试在https://mobile.ng.bluemix.net/imfpush/#!/devices/put_apps_applicationId_devices_deviceId上使用API​​ swigger PUT / apps / {applicationId} / devices / {deviceId} 。 但是我有一个错误信息 { "code": "FPWSE0001E", "message": "Not Found – The target resource 'PushDevice' does not exist. Check the '23e107c7292d17a772914af05c23d10750613aaa' parameter." } 请帮助给我你的想法

mongoose保存一个空的物体

我有一个与数据保存到数据库的问题,mongoose保存没有价值的空对象。 使用平均堆栈。 控制器:例如,我发送一些“你好消息” $http({ method: 'POST', url: '/api/message', headers: {'Content-Type': 'application/json'}, data: JSON.stringify({msg: $scope.message}) }). success(function(response) { console.log("Success " + JSON.stringify(response)); }). error(function(response) { console.log("Error " + JSON.stringify(response)); }); server.js var bodyParser = require('body-parser'); app.use(bodyParser.urlencoded({'extended':'true'})); app.use(bodyParser.json()); app.use(bodyParser.json({type: 'application/vnd.api+json'})); var message = mongoose.model('Message', { message: String }) app.post('/api/message', function(req,res) { var message = new Message(req.body); message.save(function(err) […]

Grunt Node和Express Local Dev HTTPS证书

我试图在服务人员开始,并阅读你需要有一个SSL证书。 我有一个AngularJS 1.x应用程序和一个Node Express后端,我独立运行,所以我使用grunt serve来运行端口8443的前端,我使用node app.js来运行7443上的express。 注意:我在macOS上这样做 我使用了关于如何在使用Grunt的项目上设置https的指南: 这里 openssl genrsa -out livereload.key 1024 openssl req -new -key livereload.key -out livereload.csr openssl x509 -req -in livereload.csr -signkey livereload.key -out livereload.crt Gruntfile.js options: { protocol: 'https', // or 'http2' port: 8443, hostname: '0.0.0.0', key: grunt.file.read('livereload.key'), cert: grunt.file.read('livereload.crt') }, 节点app.js var privateKey = fs.readFileSync('../livereload.key', 'utf8'); var certificate […]