Tag: angularjs

在node-sass@0.9.6安装脚本“node build.js”失败

我在项目上运行npm install时遇到这个错误。 以下有关此问题的其他信息, npm ERR! node-sass@0.9.6 install: `node build.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the node-sass@0.9.6 install script 'node build.js'. npm ERR! This is most likely a problem with the node-sass package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: […]

JavaScript文件无法find并加载

我正在学习使用MEAN堆栈的教程。 我达到了我应该开始使用Node的地步。 一切都安装完毕,我已经把angular度和引导脚本放在各自的文件夹中。 问题是,当我尝试在localhost:3000中运行应用程序时,找不到这些文件。 我得到的错误: 我的项目的目录结构: 这是迄今为止的代码: index.ejs <!DOCTYPE html> <html ng-app = "flapperNews"> <link rel="stylesheet" type="text/css" href="../public/stylesheets/bootstrap.css"> <style> .glyphicon-thumbs-up { cursor : pointer; } </style> <head> <title></title> </head> <body> <div class = "row"> <div class = "col-md-6 col-md-offset-3"> <ui-view></ui-view> </div> </div> <script type="text/ng-template" id = "/home.html"> <div class = "row"> <div class = "col-md-6 […]

使用Angular-cli创build新项目时出错

当我试图通过使用命令创build新的项目, 新的项目名称 ,我得到像下面的错误: fs.js:640 return binding.open(pathModule._makeLong(path),stringToFlags(flags),mode); ^ TypeError:path必须是Object.fs.readFileSync(fs.js:508:33)上的Object.fs.openSync(fs.js:640:18)上的TypeError(native)上的string或缓冲区,位于Function.Version.fromProject (/usr/lib/node_modules/angular-cli/upgrade/version.js:87:31)at Function.Version.isPreWebpack(/usr/lib/node_modules/angular-cli/upgrade/version.js:111:31)位于/ usr / usr / lib / node_modules / angular-cli / bin / ng:25:15处的Function.Version.assertPostWebpackVersion(/usr/lib/node_modules/angular-cli/upgrade/version.js:97:18) /lib/node_modules/angular-cli/node_modules/resolve/lib/async.js:44:21 at ondir(/usr/lib/node_modules/angular-cli/node_modules/resolve/lib/async.js:187:31)在/usr/lib/node_modules/angular-cli/node_modules/resolve/lib/async.js:153:39 Ubuntu 14.04 64位 节点6.6.0 npm 3.9.5 angular-cli@1.0.0-beta.14 我在安装angular-cli时怀疑有些问题,但我不确定。 任何帮助将是有益的。

MEAN堆栈安装提供304和404s

当我尝试安装MEAN堆栈后,当我转到http://myipaddress:3000时,我得到这些304和404 $ node server Express app started on port 3000 GET / 304 973ms GET /lib/bootstrap/js/bootstrap.js 404 371ms GET /lib/bootstrap/css/bootstrap.css 404 489ms GET /lib/angular/angular.js 404 371ms GET /lib/jquery/jquery.js 404 447ms GET /lib/bootstrap/css/bootstrap-responsive.css 404 453ms GET /lib/angular-cookies/angular-cookies.js 404 75ms GET /lib/angular-resource/angular-resource.js 404 217ms GET /lib/angular-ui-utils/modules/route.js 404 217ms GET /lib/angular-bootstrap/ui-bootstrap-tpls.js 404 221ms 所有这些lib / *文件都在public / lib […]

debuggingprotactor(有/没有webstorm)

所以我从量angular器开始,我想debugging我的testing代码: describe('stuff', function(){ it('should find the specs item, and its empty', function(){ browser.debugger(); gotoHome(); var allItems = element.all('li in model.tags'); var specsDashboardElement; for (var i=0 ; i < allItems.length; ++i) { var elem = allItems[i]; var text = elem.findElement(by.css('.li-title').getText()); // does this even work?? dunno if (text == "Specs") specsDashboardElement = elem; } expect(specsDashboardElement.isDisplayed()).toBe(true); }); […]

阻止使用AngularJs和Node.js / Express直接访问文件

使用Angular和Node.js / Express,是否有办法阻止直接访问我的部分.html文件,同时仍然允许以下路由处理: 我的Angular路线如下所示: $stateProvider.state('albums', { url: '/albums', templateUrl: '/public/albums', controller: 'AlbumsCtrl' }); 那么我的快递应用程序做以下几点: app.get('/public/albums', function(req, res){ res.sendfile('views/partials/albums.html'); }); 这一切工作正常,但键入“mysite.com/public/albums”允许访问部分.html文件。 由于内容被单独加载,用户需要login才能看到任何内容,但是我仍然希望以某种方式阻止访问此文件。

预期的响应包含一个数组,但有一个对象

所以我是Angular的新手,我也研究过其他的解决scheme,但似乎没有人为我工作。 我的应用程序需要从mongodb数据库获取一些数据并将其显示给客户端。 事情是我得到的 错误:[$ resource:badcfg]操作query资源configuration错误。 预期的响应包含一个数组,但有一个对象 这是我的客户端上的SchoolCtrl.js app.controller('SchoolsCtrl', function($scope, SchoolResource) { $scope.schools = SchoolResource.query(); }); 这是我的ngResource app.factory('SchoolResource', function($resource) { var SchoolResource = $resource('/api/schools/:id', {id: '@id'}, { update: {method: 'PUT', isArray: false}}); return SchoolResource; }); 这是我在服务器上的SchoolsController var School = require('mongoose').model('School'); module.exports.getAllSchools = function(req, res, next) { School.find({}).exec(function(err, collection) { if(err) { console.log('Schools could not be loaded: […]

删除NG重复量angular器中的logging

所以我正在做量angular器和angular度的e2etesting, 我的第一个testing是在列表中添加一个元素, 现在我正试图删除它,而且我也遇到了麻烦 所以这是我需要做的: find我要删除的logging的名称 点击同一行的垃圾桶图标并将其删除 在出现的popup窗口上按确定 尽可能地避免使用By.css,并且更喜欢与angular度有关的所有东西(byBinding,model等)。 这是因为这部分应用程序最终会改变,因此我将不得不重做所有这些情况。 HTML: … <div class="list-group-item ng-scope" ng-repeat="item in teamList"> <span class="glyphicon glyphicon-user"></span> <span ng-bind="item.name" class="memberName ng-binding">nuevo Team</span> <a ng-click="editTeam(item._id)" class="hand-cursor"> <span class="glyphicon glyphicon-edit memberRemoveBotton"></span> </a> <a ng-confirm-click="Would you like to delete this item?" confirmed-click="deleteTeam(item._id)" class="hand-cursor"> <span class="glyphicon glyphicon-trash memberRemoveBotton"></span> </a> </div> JS: describe('Testing delete Item',function() { it('Should […]

如何说量angular器等到页面加载?

我的应用程序需要一些页面的login页面。所以量angular器尝试input用户名前加载页面。所以我需要说量angular器等待login页面加载。 你能帮我什么命令我需要使用这个和我需要使用?(请修改我的代码添加等待命令) PFB为我的onPrepare和beforeeachfunction onPrepare: function() { browser.driver.manage().window().maximize(); jasmine.getEnv().addReporter(new HtmlReporter({ }) } beforeEach(function() { browser.get('https://accounts.google.com/'); //browser.manage().timeouts().pageLoadTimeout(30000); //browser.manage().timeouts().implicitlyWait(5000); //browser.sleep( 10000 ); //browser.waitForAngular(); }); 我使用了那些注释的function,但是这对我没有任何作用。 请引导我。提前感谢。

NodeJS / Express4端点生成损坏的xlsx文件

我正在尝试使用NodeJS / express 4创build一个端点,并生成一个xlsx文件并发送给用户。 要创buildxlsx文件,我正在使用node-xlsx库。 var xlsx = require('node-xlsx'); var buffer = xlsx.build([{ name: pasta, data: data }]); res.setHeader('Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); res.setHeader("Content-Disposition", "attachment; filename=" + pasta + ".xlsx"); res.write(buffer, 'binary'); return res.end(); 我试图通过一个Angular应用程序下载这个文件。 $http.post('https://endpoint/v1/' + folderName + '/reportExcel', { responseType: 'arraybuffer' }) .success(function(response) { var blob = new Blob([response], { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" }); var objectUrl = […]