小编Dav*_*vid的帖子

Angular2路由器错误:无法找到主插座加载'HomePage'

我刚开始使用新的路由库(@ angular/router v3.0.0-alpha.7),但是遵循官方文档会导致以下错误:

browser_adapter.ts:74: EXCEPTION: Error: Uncaught (in promise): Error: Cannot find primary outlet to load 'HomePage'
Run Code Online (Sandbox Code Playgroud)

问题是 - 如何摆脱错误并使路由器按预期运行?我错过了一个设置吗?

(使用alpha.6版本时会出现相同的错误.)

app.component.ts

import { Component } from '@angular/core';
import { ROUTER_DIRECTIVES } from '@angular/router';

@Component({
    selector: 'app',
    template: `
        <p>Angular 2 is running...</p>
        <!-- Routed views go here -->
        <router-outlet></router-outlet>
    `,
    providers: [ROUTER_DIRECTIVES]
})
export class AppComponent {
}
Run Code Online (Sandbox Code Playgroud)

app.routes.ts

import { provideRouter, RouterConfig } from '@angular/router';
import { HomePage } from './pages/home/home';

export const routes: RouterConfig = …
Run Code Online (Sandbox Code Playgroud)

router angular

77
推荐指数
3
解决办法
8万
查看次数

intl扩展名:安装php_intl.dll

我正在尝试找到php_intl.dll并安装它.

有人有任何提示吗?

php windows-xp intl

73
推荐指数
6
解决办法
19万
查看次数

卷曲错误18 - 转移关闭,剩余未完成的读取数据

当使用curl从URL检索数据时,我有时(在80%的情况下)得到

错误18:传输关闭,剩余未完成的读取数据

然后丢失部分返回的数据.奇怪的是,这并不会发生在CURLOPT_RETURNTRANSFER设置为false,那就是curl_exec函数不返回数据,而是直接显示的内容.

可能是什么问题呢?我可以设置一些选项来避免这种行为吗?

php curl

64
推荐指数
5
解决办法
11万
查看次数

docker push to Google Container Registry 错误“调用者没有权限‘storage.buckets.create’”

将我的映像推送到 Container Registry 时遇到权限问题。我得到的错误是

denied: Token exchange failed for project '<my project>'. Caller does not have permission 'storage.buckets.create'. To configure permissions, follow instructions at: https://cloud.google.com/container-registry/docs/access-control
Run Code Online (Sandbox Code Playgroud)

我一步一步地按照说明进行操作,这是我所做的:

  1. gcloud auth configure-docker

我的 docker config.json 现在包含:

{
  "auths": {},
  "credHelpers": {
    "gcr.io": "gcloud",
    "us.gcr.io": "gcloud",
    "eu.gcr.io": "gcloud",
    "asia.gcr.io": "gcloud",
    "staging-k8s.gcr.io": "gcloud",
    "marketplace.gcr.io": "gcloud"
  },
  "credsStore": "wincred",
  "HttpHeaders": {
    "User-Agent": "Docker-Client/18.09.0 (windows)"
  },
  "stackOrchestrator": "swarm"
}
Run Code Online (Sandbox Code Playgroud)
  1. 标记我的图像 docker tag my/image eu.gcr.io/<my project>/my-image:latest

  2. 运行docker push eu.gcr.io/<my project>/my-image:latest(错误如下)

这是我的设置

  • Windows 10(10.0.17134 内部版本 17134)
  • Docker …

docker gcloud google-container-registry

8
推荐指数
2
解决办法
1966
查看次数

Mysql ASCII与Uni​​code

快一点:

将SELECT ... WHERE name LIKE'...'如果name列是ASCII而不是UTF-8,查询会更快吗?

谢谢!

mysql unicode ascii utf-8

2
推荐指数
2
解决办法
1930
查看次数

ANTLR4在更长的文件上抛出java.lang.StackOverflowError

我正在研究一种语法,该语法分析潜在的大型降价式文本。文本的“代码”部分用于构建要评估的AST,而其余文本则被忽略。我的实现方式是读取文本,直到找到“`”符号(重音符号),然后再推“代码”模式,该模式负责解析允许的表达式。下一个重音将弹出此模式并继续循环。

问题是读取较大的文本块时出现堆栈溢出错误:

Exception in thread "main" java.lang.StackOverflowError
    at org.antlr.v4.runtime.CommonToken.<init>(CommonToken.java:113)
    at org.antlr.v4.runtime.CommonTokenFactory.create(CommonTokenFactory.java:94)
    at org.antlr.v4.runtime.CommonTokenFactory.create(CommonTokenFactory.java:40)
    at org.antlr.v4.runtime.Lexer.emit(Lexer.java:269)
    at org.antlr.v4.runtime.Lexer.nextToken(Lexer.java:180)
    at org.antlr.v4.runtime.BufferedTokenStream.fetch(BufferedTokenStream.java:187)
    at org.antlr.v4.runtime.BufferedTokenStream.sync(BufferedTokenStream.java:170)
    at org.antlr.v4.runtime.BufferedTokenStream.consume(BufferedTokenStream.java:154)
    at org.antlr.v4.runtime.Parser.consume(Parser.java:588)
    at org.antlr.v4.runtime.Parser.match(Parser.java:220)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:160)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:161)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:161)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:161)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:161)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:161)
    at decimill.parser.TestGrammarParser.start_line(TestGrammarParser.java:113)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:168)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:161)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:161)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:161)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:161)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:161)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:161)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:161)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:161)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:161)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:161)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:161)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:161)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:161)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:161)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:161)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:161)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:161)
    at decimill.parser.TestGrammarParser.line(TestGrammarParser.java:161)
    at …
Run Code Online (Sandbox Code Playgroud)

java stack-overflow parsing antlr4

1
推荐指数
1
解决办法
640
查看次数