草庐IT

grunt-build-control

全部标签

javascript - 如何从页面中的jquery调用angular js函数 Controller

如何从jquery调用angularjs函数或Controller我是这个angularjs的新手这是我的功能,我必须从jquery传递var1和var2我已经搜索了很多文章,但我无法理解。请帮助我functioncustomersController($scope,$http){$http.get("https://tic.com/testingservice/HttpService.svc/operator/var1/var2").success(function(response){$scope.names=response;});} 最佳答案

javascript - 名称为 'PokemonCtrl' 的 Controller 未注册

我正在尝试向我的Angularjs应用程序添加一个Controller。这是我第一次在不使用$scope作为依赖项的情况下设置它,并使用路由来声明我正在使用的Controller。PokemonCtrl没有注册我做错了什么?另外,如果我在路由中声明Controller是否意味着我不必在其他任何地方声明它?app.js'usestrict';/***@ngdocoverview*@namepokedexApp*@description*#pokedexApp**Mainmoduleoftheapplication.*/angular.module('pokedexApp',['ngAni

javascript - 你能把 grunt.js 中的 linter 改成 jslint 吗?

我看到grunt.js中的默认linter是jshint,但我已经习惯了使用jslint。是否可以更改grunt.js使用的linter? 最佳答案 无耻的self推销有一个插件:https://npmjs.org/package/grunt-jslint 关于javascript-你能把grunt.js中的linter改成jslint吗?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questi

javascript - UI-Router 和解析, Controller 中的未知提供程序

我在UI-Router.state()调用中使用resolve。在我的Controller中,我可以毫无问题地访问这些值,但它会抛出如下错误:$injector/unpr?p0=ctrlOptionsProvider%20%3C-trlOptions以下代码抛出错误,但允许我访问变量ctrlOptions就好了:.state('new_user',{url:"/user/new",templateUrl:"views/user/new.html",data:{pageTitle:'NewUser'},controller:"UserController",resolve:{ctrlOp

javascript - Node/NPM/Grunt 在 jscs (grunt-jscs) 上失败

我有一个在javascript代码库上运行JSCS的grunt任务,它一直在工作,直到需要与使用最新、稳定版本的grunt、npm/node的构建服务器集成。这一切在npm1.XX.X下运行良好,但在我升级到2.XX.X后它就坏了。我尝试了最新的3.XX.X,但失败的方式与2.XX.X相同。我假设所需的相关部分是命令行输出:$node-vv5.2.0$npm-v3.3.12$grunt--versiongrunt-cliv0.1.13gruntv0.4.5$gruntjscsLoading"jscs.js"tasks...ERROR>>TypeError:fn.callisnotafu

javascript - QUnit 测试在 Travis CI 上失败(在带有 grunt.js 的 phantomjs 上运行)

我们在JavaScript上的开源项目enchant.js中引入了带有travisCI的CI系统。https://github.com/wise9/enchant.js我们喜欢qunit测试,我们使用grunt.js(npm)运行它们,但它在TravisCI上失败并出现如下错误:PhantomJStimedout,possiblyduetoamissingQUnitstart()call.Use--forcetocontinue.完整的错误信息在这里:https://travis-ci.org/wise9/enchant.js/builds/4016842奇怪的是,每次我运行grunt

javascript - 我怎样才能强制在 grunt 中运行的 JSHint 始终使用 --verbose 标志

我有一个特定的JSHint/Grunt设置,我想在其中完成以下操作:从单个.jshintrc文件加载以允许我的IDElinter获取我的设置能够在其他grunt任务中覆盖.jshintrc中的单个选项让JSHint始终以详细模式运行,以便我始终可以看到警告编号,而无需使用--verbose运行所有grunt以下允许我从.jshintrc加载并始终以冗长的方式运行,但不允许选项覆盖。文档中提到应该是这种情况,但没有提及有效的详细选项:jshint:{options:{jshintrc:'.jshintrc',verbose:true,},source:{options:{ignores:

javascript - cakephp 2.2 在 Controller 中检索 json 数据

我正在尝试使用JQuery从网页发送JSON数据,如下所示:$.ajax({type:"post",//Requestmethod:post,geturl:"http://localhost/ajax/login",data:'{username:"wiiNinja",password:"isAnub"}',dataType:"json",//ExpectedresponsetypecontentType:"application/json",cache:false,success:function(response,status){alert("Success");},error:f

javascript - Ember.js:将 Em.$.getJSON 转换为 promise 并将响应绑定(bind)到 Controller 上下文的正确方法?

我正在使用$.getJSON获取一些数据,我想将这些数据异步绑定(bind)到Controller上下文。我在我的route想出了这个-它有效,但我对此并不满意:setupController:function(controller,model){this._super(controller,model);Em.RSVP.Promise.cast(Em.$.getJSON((this.get('ENV.apiBaseURL'))+"/users/current/live_matchday_stats")).then((function(_this){returnfunction(s){

javascript - 了解 Ember 中 Controller 和路由之间的关系

我在理解Ember应用程序中Controller和路由之间的概念关系时遇到了一些困难。我已经开始了一个非常简单的尖峰测试来评估Ember,我越深入,我就越发现我的路线充满了我应该通过的东西,这应该是Controller的责任,例如操作、连接模型以及最终分派(dispatch)到View以呈现模板。Controller都是空的,似乎只是一些自动映射需求的占位符。我是否遗漏了一个基本的东西——从Rails的Angular来看,并将“railsway”应用(可能是错误的)到Ember我希望我的路由定义由URL表示的状态,这些状态将映射到Controller“行动”。如有任何指点,我们将不胜感