Giter VIP home page Giter VIP logo

awesome-tutorials's Issues

项目所用的ng的版本具体是多少?

之所以提这个是因为我在本地无法运行项目,应该是版本的问题。
你在 readMe.md 文件里的 "环境配置要求" 部分写了 安装ng的命令,但最好补充下安装的ng的版本,比如在文章补充一下 "npm install -g @angular/cli@latest 命令执行后,安装的版本是 2.4.10",或者命令里指定ng版本

Cannot find module '@angular/animations'

依赖包安装后,执行ng serve 后报错,找不到 @angular/animations 模块

我猜应该是因为 animations 从Angular 最新版本的core模块中移除了,代码需要根据具体的Angular 版本改动吧,比如import导入模块语句。

完整的信息,包括ng版本信息,主要是报错信息:
执行 ng -v
@angular/cli: 1.0.1
node: 6.9.4
os: win32 x64
@angular/common: 2.4.10
@angular/compiler: 2.4.10
@angular/core: 2.4.10
@angular/flex-layout: 2.0.0-beta.8
@angular/forms: 2.4.10
@angular/http: 2.4.10
@angular/material: 2.0.0-beta.3
@angular/platform-browser: 2.4.10
@angular/platform-browser-dynamic: 2.4.10
@angular/router: 3.4.10
@angular/cli: 1.0.1
@angular/compiler-cli: 2.4.10

执行 ng serve
** NG Live Development Server is running on http://localhost:4200 **
Hash: dfda5f6efe13451ae887
Time: 33757ms
chunk {0} main.bundle.js, main.bundle.js.map (main) 68.4 kB {2} [initial] [rendered]
chunk {1} styles.bundle.js, styles.bundle.js.map (styles) 67 kB {3} [initial] [rendered]
chunk {2} vendor.bundle.js, vendor.bundle.js.map (vendor) 4.89 MB [initial] [rendered]
chunk {3} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]

WARNING in ./~/.2.0.0-beta.8@@angular/flex-layout/media-query/breakpoints/break-points-token.js
13:29-43 "export 'InjectionToken' was not found in '@angular/core'

WARNING in ./~/.2.0.0-beta.8@@angular/flex-layout/flexbox/api/flex.js
299:12-21 "export 'Renderer2' was not found in '@angular/core'

WARNING in ./~/.2.0.0-beta.8@@angular/flex-layout/flexbox/api/layout.js
177:12-21 "export 'Renderer2' was not found in '@angular/core'

WARNING in ./~/.2.0.0-beta.8@@angular/flex-layout/flexbox/api/show-hide.js
296:12-21 "export 'Renderer2' was not found in '@angular/core'

WARNING in ./~/.2.0.0-beta.8@@angular/flex-layout/flexbox/api/flex-align.js
177:12-21 "export 'Renderer2' was not found in '@angular/core'

WARNING in ./~/.2.0.0-beta.8@@angular/flex-layout/flexbox/api/flex-fill.js
53:12-21 "export 'Renderer2' was not found in '@angular/core'

WARNING in ./~/.2.0.0-beta.8@@angular/flex-layout/flexbox/api/flex-offset.js
163:12-21 "export 'Renderer2' was not found in '@angular/core'

WARNING in ./~/.2.0.0-beta.8@@angular/flex-layout/flexbox/api/flex-order.js
161:12-21 "export 'Renderer2' was not found in '@angular/core'

WARNING in ./~/.2.0.0-beta.8@@angular/flex-layout/flexbox/api/layout-align.js
256:12-21 "export 'Renderer2' was not found in '@angular/core'

WARNING in ./~/.2.0.0-beta.8@@angular/flex-layout/flexbox/api/layout-wrap.js
204:12-21 "export 'Renderer2' was not found in '@angular/core'

WARNING in ./~/.2.0.0-beta.8@@angular/flex-layout/flexbox/api/layout-gap.js
243:12-21 "export 'Renderer2' was not found in '@angular/core'

WARNING in ./~/.2.0.0-beta.8@@angular/flex-layout/flexbox/api/class.js
287:12-21 "export 'Renderer2' was not found in '@angular/core'

WARNING in ./~/.2.0.0-beta.8@@angular/flex-layout/flexbox/api/style.js
333:12-21 "export 'Renderer2' was not found in '@angular/core'

ERROR in F:/test/ng2-tut/node_modules/@angular/material/typings/dialog/dialog-container.d.ts (2,32): Cannot find module '@angular/animations'.

ERROR in F:/test/ng2-tut/node_modules/@angular/material/typings/menu/menu-animations.d.ts (1,42): Cannot find module '@angular/animations'.

ERROR in F:/test/ng2-tut/node_modules/@angular/material/typings/select/select-animations.d.ts (1,42): Cannot find module '@angular/animations'.

ERROR in F:/test/ng2-tut/node_modules/@angular/material/typings/snack-bar/snack-bar-container.d.ts (2,32): Cannot find module '@angular/animations'.

ERROR in F:/test/ng2-tut/node_modules/@angular/material/typings/tabs/tab-body.d.ts (2,32): Cannot find module '@angular/animations'.

ERROR in F:/test/ng2-tut/node_modules/@angular/material/typings/tooltip/tooltip.d.ts (2,32): Cannot find module '@angular/animations'.

ERROR in F:/test/ng2-tut/node_modules/@angular/flex-layout/flexbox/api/base.d.ts (8,22): Module '"F:/test/ng2-tut/node_modules/@angular/core/index"' has no exported member 'Renderer2'.

ERROR in F:/test/ng2-tut/node_modules/@angular/flex-layout/flexbox/api/base-adapter.d.ts (8,22): Module '"F:/test/ng2-tut/node_modules/@angular/core/index"' has no exported member 'Renderer2'.

ERROR in F:/test/ng2-tut/node_modules/@angular/flex-layout/media-query/breakpoints/break-points-provider.d.ts (8,10): Module '"F:/test/ng2-tut/node_modules/@angular/core/index"' has no exported member 'InjectionToken'.

ERROR in F:/test/ng2-tut/node_modules/@angular/flex-layout/media-query/breakpoints/break-points-token.d.ts (8,10): Module '"F:/test/ng2-tut/node_modules/@angular/core/index"' has no exported member 'InjectionToken'.

ERROR in Error encountered resolving symbol values statically. Calling function 'InjectionToken', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol BREAKPOINTS in F:/test/ng2-tut/node_modules/@angular/flex-layout/media-query/breakpoints/break-points-token.d.ts, resolving symbol DEFAULT_BREAKPOINTS_PROVIDER in F:/test/ng2-tut/node_modules/@angular/flex-layout/media-query/breakpoints/break-points-provider.d.ts, resolving symbol FlexLayoutModule in F:/test/ng2-tut/node_modules/@angular/flex-layout/flexbox/_module.d.ts, resolving symbol FlexLayoutModule in F:/test/ng2-tut/node_modules/@angular/flex-layout/flexbox/_module.d.ts

ERROR in .//.2.0.0-beta.3@@angular/material/@angular/material.es5.js
Module not found: Error: Can't resolve '@angular/animations' in 'F:\test\ng2-tut\node_modules.2.0.0-beta.3@@angular\material@angular'
@ ./
/.2.0.0-beta.3@@angular/material/@angular/material.es5.js 20:0-81
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts

ERROR in .//.0.27.3@css-loader?{"sourceMap":false,"importLoaders":1}!.//.1.3.3@postcss-loader?{"ident":"postcss"}!.//.6.0.3@sass-loader/lib/loader.js?{"sourceMap":false,"precision":8,"includePaths":[]}!./src/styles.scss
Module build failed:
@import '
@angular/material/core/theming/all-theme';
^
File to import not found or unreadable: ~@angular/material/core/theming/all-theme.
Parent style sheet: stdin
in F:\test\ng2-tut\src\styles.scss (line 1, column 1)
@ ./src/styles.scss 4:14-211
@ multi ./src/styles.css ./src/styles.scss
webpack: Failed to compile.

112页笔误

112页倒数第三段最后一行笔误

是不是我的模块改拆分了?

应该为

是不是我的模块该拆分了?

另外有一个问题想请教一下:

如果我使用了 路由 配合 <router-outlet> 是不是 就没法往 里传递 @input 属性了? 比如像这样:

<router-outlet  [var1]="var_a" [var2]="var_b"></router-outlet>

哪怕我能够保证所有插入outlet 的组件 都有 var1 和 var2 的 Input 属性变量。

关于AOT

@wpcfan 你好,
我之前都是用jit的那种模式配置,然后我参考你关于aot的说明,在main.ts中改用:
image
但提示 cannot find module app.module.ngfactory ,请问这个app.module.ngfactory是哪来的呢?还需要怎么配置?
谢谢!

第三章运行报错请教

我按照书上的代码敲进去,但是运行的时候报错,求指导。

Error ​ columnNumber: 31 ​ fileName: "http://localhost:4200/polyfills.bundle.js line 597 > eval" ​ lineNumber: 809 ​ message: "Uncaught (in promise): Object: {\"body\":{\"error\":\"Object(...) is not a function\"},\"url\":\"api/todos\",\"headers\":{\"Content-Type\":[\"application/json\"]},\"status\":500,\"statusText\":\"Internal Server Error\"}" ​ promise: Object { __zone_symbol__state: 0, __zone_symbol__value: {…} } ​ rejection: Object { url: "api/todos", status: 500, statusText: "Internal Server Error", … } ​ stack: "resolvePromise@webpack-internal:///./node_modules/zone.js/dist/zone.js:809:31\nresolvePromise@webpack-internal:///./node_modules/zone.js/dist/zone.js:775:17\nscheduleResolveOrReject/<@webpack-internal:///./node_modules/zone.js/dist/zone.js:858:17\nZoneDelegate.prototype.invokeTask@webpack-internal:///./node_modules/zone.js/dist/zone.js:421:17\nonInvokeTask@webpack-internal:///./node_modules/@angular/core/esm5/core.js:4956:24\nZoneDelegate.prototype.invokeTask@webpack-internal:///./node_modules/zone.js/dist/zone.js:420:17\nZone.prototype.runTask@webpack-internal:///./node_modules/zone.js/dist/zone.js:188:28\ndrainMicroTaskQueue@webpack-internal:///./node_modules/zone.js/dist/zone.js:595:25\nZoneTask.invokeTask@webpack-internal:///./node_modules/zone.js/dist/zone.js:500:21\nZoneTask/this.invoke@webpack-internal:///./node_modules/zone.js/dist/zone.js:485:28\ntimer@webpack-internal:///./node_modules/zone.js/dist/zone.js:2025:17\n" ​ task: Object { runCount: 0, _state: "notScheduled", type: "microTask", … } ​ zone: Object { _properties: {…}, _parent: {…}, _name: "angular", … } ​ __proto__: Object { … }

关于对话框

文章中使用 angular2-mdl 产生对话框,可是现在 安装了 angular2-mdl 更本找不到 MdlDialog 这个名字。请问该如何使用? 谢谢。

请教一下, 按照书上代码敲完第三章代码 ,运行时报错如下,求指教

ERROR in E:/GithubClone/Angular-Demo/angular01/node_modules/angular-in-memory-web-api/http-client-backend.service.d.ts (1,97): Cannot find module '"@"angular/common/http'.

ERROR in E:/GithubClone/Angular-Demo/angular01/node_modules/angular-in-memory-web-api/http-client-in-memory-web-api.module.d.ts (2,41): Cannot find module '"@"angular/common/http'.

Cannot find module 'angular/common/http'.

234页笔误

constructor(private store$: Store<Todo[]>){
...
this.todos = this.store$.select('todos');
}

查看源码发现上面的Store<Todo[]>应该是Store

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.