小编Jan*_*Dev的帖子

Angular TranslateService翻译<title>标签

TranslateService在Angular中使用我希望位于<title>其中的标记使用index.html 不同的语言.

<title translate>application.title</title>
Run Code Online (Sandbox Code Playgroud)

我翻译所有其他html标签,除非他们是自定义html标签,然后它是这样的:

{{"document.name"|translate}}
Run Code Online (Sandbox Code Playgroud)

问题可能是index.html在文件夹中处于不同的级别

src
| -app
....
| -translation | -index.html

typescript angular

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

GitHub Pages无法加载资源

我试图angular-cli-ghpageshttps://ewoutg.github.io/ePortfolio/在GitHub Pages上使用Bootstrap 4托管Angular应用程序,但遇到了以下一些错误:

Failed to load resource: styles.05418b2b9d65514cb185.bundle.css the server responded with a status of 404 (Not Found)`
Run Code Online (Sandbox Code Playgroud)

我的确有一个Dist文件夹,其中包含该资源:

文件夹结构的屏幕截图

我究竟做错了什么?我怎样才能解决这个问题?

github-pages bootstrap-4 angular

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

打字稿无效

我将角度升级到4,角度cli升级到1.03.运行命令后,npm ls typescript我得到:

+-- @angular/cli@1.0.3
| `-- typescript@2.2.2
`-- typescript@2.2.2  invalid

npm ERR! invalid: typescript@2.2.2 C:\development\projects-git\mydoc\static-web\node_modules\typescript
Run Code Online (Sandbox Code Playgroud)

第一个和第二个打字稿之间的区别是什么,为什么第二个打字机无效/如何解决?

我认为上面的错误是我得到下面的错误的原因所以我希望有两个修复,所以我可以再次运行我的应用程序.

ERROR in AppModule is not an NgModule
ERROR in ./src/main.ts
Module build failed: TypeError: Cannot read property 'newLine' of undefined
    at Object.getNewLineCharacter (..\static-web\node_modules\typescript\lib\typescript.js:9580:20)
    at Object.createCompilerHost (..\static-web\node_modules\typescript\lib\typescript.js:66674:26)
    at Object.ngcLoader (..\static-web\node_modules\@ngtools\webpack\src\loader.js:202:31)
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts
Run Code Online (Sandbox Code Playgroud)

node.js typescript angular-cli angular

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