我一直想知道,每当Angular日志出错时,就会出现类似这样的乱码:
Error: [ng:areq] Argument 'AppController' is not a function, got undefined
http://errors.angularjs.org/1.2.23/ng/areq?p0=AppController&p1=not%20a%20function%2C%20got%20undefined
at http://localhost/NAME/vendors/angular/angular.js:78:12
at assertArg (http://localhost/NAME/vendors/angular/angular.js:1509:11)
at assertArgFn (http://localhost/NAME/vendors/angular/angular.js:1519:3)
at http://localhost/NAME/vendors/angular/angular.js:7271:9
at http://localhost/NAME/vendors/angular/angular.js:6663:34
at forEach (http://localhost/NAME/vendors/angular/angular.js:332:20)
at nodeLinkFn (http://localhost/NAME/vendors/angular/angular.js:6650:11)
at compositeLinkFn (http://localhost/NAME/vendors/angular/angular.js:6098:13)
at compositeLinkFn (http://localhost/NAME/vendors/angular/angular.js:6101:13)
at compositeLinkFn (http://localhost/NAME/vendors/angular/angular.js:6101:13)
Run Code Online (Sandbox Code Playgroud)
我怎么知道MY代码的哪一行(不是角度源代码)触发了错误?添加断点或Batarang没有帮助.
我没有遇到这个特定错误的问题.有些情况下,角度会记录一个行号,比如说Controller.js:1183:48不会记录行号.有什么区别?在后一种情况下,我如何找出我的错误行?
HTML:
<div ng-repeat="obj in arr">
<custom-directive status-stored-in="obj"></custom-directive>
</div>
Run Code Online (Sandbox Code Playgroud)
问题:
我为大量的objs 内置了翻页.这意味着arr代表objs 当前页面的值将发生变化.然而,obj在status-stored-in="obj"部分不与改变刷新.
现在我的解决方案是添加一个ng-ifin customDirective,来回闪烁它的值以强制重新编译.还有其他等效的,更简洁的方法来处理这个问题吗?
自定义指令的开头:
module.directive 'checkbox', (checkboxHooks) ->
restrict: 'E'
scope:
hook: '='
hookedTo: '='
statusStoredIn: '='
templateUrl: 'templates/checkbox.html'
link: (scope, element, attr) ->
Run Code Online (Sandbox Code Playgroud)
我在两台计算机上打开页面,ip和localhost都尝试过:
奇怪的是,对于一台计算机来说,它http://192.168.1.100/dev并没有起作用http://localhost/dev.对于另一个,没有工作.它说,
来自"null"的图像已被跨源资源共享策略阻止加载:收到无效响应.
'http://localhost'因此不允许原点访问.
我找到的答案似乎都没有效果.我不明白为什么它只能localhost在一台计算机上运行.有什么建议?
编辑:
http://127.0.0.1/dev 也没用我已经尝试在application.rb中添加它
config.action_controller.default_url_options = { :trailing_slash => true }
Run Code Online (Sandbox Code Playgroud)
以及:trailing_slash => true在routes.rb中
match '/download', to: 'welcome#download', via: 'get', :trailing_slash => true
Run Code Online (Sandbox Code Playgroud)
但似乎都不起作用.我搜索了rails 4.0 doc但找不到相关信息.我在这里错过了什么?
更新:
我试过添加
Rails.application.default_url_options[:trailing_slash] = true
Run Code Online (Sandbox Code Playgroud)
在filter_parameter_logging.rb因为这是在整个项目中,我唯一能找到的地方Rails.application.*,但它不工作要么.我在发布版本中找到了这一行,我使用的是4.0.4.我在错误的地方添加了这个吗?我在重新检查之前重新启动了服务器.
对于这个简单的问题感到抱歉,但是从我收集到的内容中也不trailing_slash应该反映在浏览器网址中,如果不是主要的话?因为这是我需要的,与历史相关.
url ruby-on-rails url-routing trailing-slash ruby-on-rails-4
So according to this question, css-loader loads file as string, resolves webpack dependency according to require, and style-loader inserts style tag into page, and in many cases, css-loader can be replaced by raw-loader.
I'm currently using:
loader: ExtractTextPlugin.extract("raw-loader!postcss-loader!sass-loader?sourceMap&" + sassIncludePaths.join(""))
Run Code Online (Sandbox Code Playgroud)
And there are requires in the .scss files, but I don't see a problem with raw-loader yet. So question is:
{
Post {
name
}
}
Run Code Online (Sandbox Code Playgroud)
在尝试检索内容类型上的所有条目时,它仅给出以下错误:
"Argument \"id\" of required type \"String!\" was not provided."
Run Code Online (Sandbox Code Playgroud)
由于id需要字段。那么如何获取某个内容类型的所有条目呢?
参考:https: //www.contentful.com/developers/docs/references/graphql/
它给了我这个错误:
Chrome 37.0.2019 (Mac OS X 10.9.3) ERROR
Uncaught ReferenceError: getJasmineRequireObj is not defined at /Users/Lucia/Desktop/test-yo-karma/dev/vendors/jasmine/src/core/Spec.js:1
Run Code Online (Sandbox Code Playgroud)
但我确保文件确实存在.并且无法在任何地方找到错误?
javascript ×3
angularjs ×2
contentful ×1
cors ×1
debugging ×1
graphql ×1
karma-runner ×1
loader ×1
mapping ×1
sass ×1
url ×1
url-routing ×1
vim ×1
webpack ×1