我刚刚将Angular更新rc-1
为最新版本rc-3
.该应用程序使用的是JavaScript ES6和SystemJS.当我使用browsersync运行应用程序时,它可以工作.但是,如果我捆绑应用程序(使用systemjs-builder)然后运行它,我在浏览器控制台中出现此错误
使用类装饰器时,需要使用未捕获的反射元数据填充程序.
问题来自使用@angular/http
基本http调用的组件,如果我删除import {Http, HTTP_PROVIDERS} from '@angular/http' ;
它有效.
此外,它不会发生在TypeScript上,但它与JS ES5和ES6一起发生.Webpack也不会发生这种情况.
我查看了捆绑的代码,看起来SystemJS在Angular
代码之前通过Reflect
代码...仅使用es6
index.js
import 'reflect-metadata';
import 'es6-shim';
import 'zone.js';
import {bootstrap} from '@angular/platform-browser-dynamic';
import {App} from './app.js';
bootstrap(App);
Run Code Online (Sandbox Code Playgroud)
app.js
import {Component} from '@angular/core';
import {Http, HTTP_PROVIDERS} from '@angular/http';
@Component({
selector: 'App',
template: '',
providers: [HTTP_PROVIDERS]
})
export class App {
constructor(http) {}
static get parameters() {
return [[Http]];
}
}
Run Code Online (Sandbox Code Playgroud) 我有一个Angular 5应用程序,运行angular-cli 1.6.6,当捆绑我的应用程序时,我(在所有其他人中)有一个common.chunk.js.
你知道这是什么吗?它与我的任何模块都不匹配,它也不是供应商或主要或polyfill,因为它们有专用的块.
我在 Django 应用中有这两个模型:
class Tag(models.Model):
name = models.CharField(max_length=100, blank=False, unique=True)
class Article(models.Model):
title = models.CharField(max_length=100, blank=True, default='')
tags = models.ManyToManyField(Tag, blank=True)
Run Code Online (Sandbox Code Playgroud)
在我看来,我想过滤文章,只获取articles.tags
包含带有id == 2
. 我怎样才能做到这一点 ?
我试过
tags = Tag.objects.filter(pk=2);
articles = Article.objects.filter(len(tags) > 0)
但我有这个错误'bool' object is not itterable
。
我有一个使用ES6的Node应用程序,我使用以下命令运行nodemon cluster.js --exec babel-node
.
我也有一个.babelrc
文件:
{
"presets": ["es2015"],
"ignore": [
"public"
]
}
Run Code Online (Sandbox Code Playgroud)
该文件夹public
包含前端文件,如html,css和js.但是,当我在公共文件夹中编辑JS文件时,babel-node
编译我的代码,我不希望这发生.
我有一个Django应用程序,我设法与Heroku部署.我的Procfile
文件只包含:
web: gunicorn omegapp3.wsgi --log-file -
Run Code Online (Sandbox Code Playgroud)
所以当我运行heroku local
它时.
但是当我部署时heroku push master
,控制台检测到一个节点应用程序,因为该应用程序有一个package.json
,然后构建失败.
我想做的是以下内容:
npm install
安装gulp
等你知道我怎么做吗?
我是Rails的新手,我根据rubyonrails.org教程开始制作一个Web应用程序。
我的应用程序是一个包含文章的博客。.我实现了创建和编辑功能,该功能运行良好,但在尝试访问http://localhost:3000/articles/2/edit
以编辑文章时突然出现错误。错误是ActionController::ParameterMissing in ArticlesController#edit param is missing or the value is empty: articles
这是我的红宝石代码:
类ArticlesController <ApplicationController def索引@articles = Article.all结束
def new
@article = Article.new
end
def edit
@article = Article.find(params[:id])
if @article.update(article_params)
redirect_to @article
else
render 'edit'
end
end
def show
@article = Article.find(params[:id])
end
def create
@article = Article.new(article_params)
if @article.save
redirect_to @article
else
render 'new'
end
end
private
def article_params
params.require(:article).permit(:title, :text)
end
end
Run Code Online (Sandbox Code Playgroud)
错误警报所针对的行是params.require(:articles).permit(:title, :text)
我真的不知道错误可能在哪里,因为2分钟前一切正常。
谢谢您的帮助
我正在使用OpenCV C++库,但我无法创建DescriptorExtractor
对象.这是我做的:
Mat img = imread("testOrb.jpg",CV_LOAD_IMAGE_UNCHANGED);
std::vector<KeyPoint> kp;
cv::Ptr<cv::ORB> detector = cv::ORB::create();
detector->detect( img, kp )
//this part works
DescriptorExtractor descriptorExtractor;
Mat descriptors;
descriptorExtractor.compute(img, kp, descriptors);
//when these 3 lines are added, an error is thrown
Run Code Online (Sandbox Code Playgroud)
但是我有以下错误消息:
OpenCV Error: The function/feature is not implemented () in detectAndCompute, file ...
Run Code Online (Sandbox Code Playgroud)