├── ch4 ├── di │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── product1 │ │ │ │ ├── product1.component.css │ │ │ │ └── product1.component.html │ │ │ ├── product2 │ │ │ │ ├── product2.component.css │ │ │ │ └── product2.component.html │ │ │ ├── app.component.html │ │ │ ├── shared │ │ │ │ ├── logger.service.ts │ │ │ │ └── another-product.service.ts │ │ │ └── app.component.ts │ │ ├── favicon.ico │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── index.html │ │ ├── main.ts │ │ └── tsconfig.json │ ├── proxy.conf.json │ ├── e2e │ │ ├── tsconfig.e2e.json │ │ ├── app.po.ts │ │ └── app.e2e-spec.ts │ └── .editorconfig └── auction │ ├── src │ ├── assets │ │ └── .gitkeep │ ├── app │ │ ├── app.component.css │ │ ├── footer │ │ │ ├── footer.component.css │ │ │ ├── footer.component.html │ │ │ └── footer.component.ts │ │ ├── navbar │ │ │ ├── navbar.component.css │ │ │ └── navbar.component.ts │ │ ├── search │ │ │ ├── search.component.css │ │ │ └── search.component.ts │ │ ├── stars │ │ │ ├── stars.component.css │ │ │ └── stars.component.html │ │ ├── product │ │ │ └── product.component.css │ │ ├── carousel │ │ │ ├── carousel.component.css │ │ │ └── carousel.component.ts │ │ ├── home │ │ │ ├── home.component.css │ │ │ ├── home.component.html │ │ │ └── home.component.ts │ │ ├── product-detail │ │ │ └── product-detail.component.css │ │ ├── app.component.ts │ │ └── app.component.html │ ├── favicon.ico │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── styles.css │ ├── index.html │ └── main.ts │ ├── proxy.conf.json │ ├── e2e │ ├── tsconfig.e2e.json │ ├── app.po.ts │ └── app.e2e-spec.ts │ └── .editorconfig ├── ch5 ├── bind │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── order │ │ │ │ ├── order.component.css │ │ │ │ └── order.component.html │ │ │ ├── search │ │ │ │ ├── search.component.css │ │ │ │ └── search.component.html │ │ │ ├── price-quote │ │ │ │ ├── price-quote.component.css │ │ │ │ └── price-quote.component.html │ │ │ ├── app.component.html │ │ │ └── pipe │ │ │ │ ├── multiple.pipe.ts │ │ │ │ └── multiple.pipe.spec.ts │ │ ├── favicon.ico │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── index.html │ │ ├── main.ts │ │ └── tsconfig.json │ ├── proxy.conf.json │ ├── e2e │ │ ├── tsconfig.e2e.json │ │ ├── app.po.ts │ │ └── app.e2e-spec.ts │ └── .editorconfig ├── auction │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── footer │ │ │ │ ├── footer.component.css │ │ │ │ ├── footer.component.html │ │ │ │ └── footer.component.ts │ │ │ ├── navbar │ │ │ │ ├── navbar.component.css │ │ │ │ └── navbar.component.ts │ │ │ ├── search │ │ │ │ ├── search.component.css │ │ │ │ └── search.component.ts │ │ │ ├── stars │ │ │ │ ├── stars.component.css │ │ │ │ └── stars.component.html │ │ │ ├── product │ │ │ │ └── product.component.css │ │ │ ├── carousel │ │ │ │ ├── carousel.component.css │ │ │ │ └── carousel.component.ts │ │ │ ├── home │ │ │ │ ├── home.component.css │ │ │ │ ├── home.component.html │ │ │ │ └── home.component.ts │ │ │ ├── product-detail │ │ │ │ └── product-detail.component.css │ │ │ ├── app.component.ts │ │ │ ├── app.component.html │ │ │ └── pipe │ │ │ │ └── filter.pipe.spec.ts │ │ ├── favicon.ico │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── index.html │ │ └── main.ts │ ├── proxy.conf.json │ ├── e2e │ │ ├── tsconfig.e2e.json │ │ ├── app.po.ts │ │ └── app.e2e-spec.ts │ └── .editorconfig └── demo1 │ ├── src │ ├── assets │ │ └── .gitkeep │ ├── app │ │ ├── life │ │ │ ├── life.component.css │ │ │ └── life.component.html │ │ ├── change │ │ │ ├── change.component.css │ │ │ └── change.component.html │ │ ├── child1 │ │ │ ├── child1.component.css │ │ │ ├── child1.component.html │ │ │ └── child1.component.ts │ │ ├── footer │ │ │ ├── footer.component.css │ │ │ ├── footer.component.html │ │ │ └── footer.component.ts │ │ ├── header │ │ │ ├── header.component.css │ │ │ └── header.component.html │ │ ├── app.component.css │ │ ├── child │ │ │ ├── child.component.css │ │ │ └── child.component.html │ │ ├── bind │ │ │ ├── bind.component.css │ │ │ ├── bind.component.html │ │ │ └── bind.component.ts │ │ └── pipe │ │ │ ├── multiple.pipe.ts │ │ │ └── multiple.pipe.spec.ts │ ├── favicon.ico │ ├── styles.css │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── index.html │ └── main.ts │ ├── proxy.conf.json │ ├── e2e │ ├── tsconfig.e2e.json │ ├── app.po.ts │ └── app.e2e-spec.ts │ └── .editorconfig ├── ch7 ├── demo │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── reactive-form │ │ │ │ └── reactive-form.component.css │ │ │ ├── template-form │ │ │ │ └── template-form.component.css │ │ │ ├── reactive-regist │ │ │ │ └── reactive-regist.component.css │ │ │ ├── app.component.ts │ │ │ └── directives │ │ │ │ ├── equal-validator.directive.ts │ │ │ │ ├── mobile-validator.directive.ts │ │ │ │ ├── equal-validator.directive.spec.ts │ │ │ │ └── mobile-validator.directive.spec.ts │ │ ├── favicon.ico │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── index.html │ │ └── main.ts │ ├── proxy.conf.json │ ├── e2e │ │ ├── tsconfig.e2e.json │ │ ├── app.po.ts │ │ └── app.e2e-spec.ts │ └── .editorconfig ├── auction │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── footer │ │ │ │ ├── footer.component.css │ │ │ │ ├── footer.component.html │ │ │ │ └── footer.component.ts │ │ │ ├── navbar │ │ │ │ ├── navbar.component.css │ │ │ │ └── navbar.component.ts │ │ │ ├── search │ │ │ │ └── search.component.css │ │ │ ├── stars │ │ │ │ ├── stars.component.css │ │ │ │ └── stars.component.html │ │ │ ├── product │ │ │ │ └── product.component.css │ │ │ ├── carousel │ │ │ │ ├── carousel.component.css │ │ │ │ └── carousel.component.ts │ │ │ ├── home │ │ │ │ ├── home.component.css │ │ │ │ ├── home.component.html │ │ │ │ └── home.component.ts │ │ │ ├── product-detail │ │ │ │ └── product-detail.component.css │ │ │ ├── app.component.ts │ │ │ ├── app.component.html │ │ │ └── pipe │ │ │ │ └── filter.pipe.spec.ts │ │ ├── favicon.ico │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── index.html │ │ └── main.ts │ ├── proxy.conf.json │ ├── e2e │ │ ├── tsconfig.e2e.json │ │ ├── app.po.ts │ │ └── app.e2e-spec.ts │ └── .editorconfig └── demo1 │ ├── src │ ├── assets │ │ └── .gitkeep │ ├── app │ │ ├── app.component.css │ │ ├── reactive │ │ │ └── reactive.component.css │ │ ├── regist1 │ │ │ └── regist1.component.css │ │ └── directives │ │ │ ├── mobile-validator.directive.ts │ │ │ ├── mobile-validator.directive.spec.ts │ │ │ └── password-validator.directive.spec.ts │ ├── favicon.ico │ ├── styles.css │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── index.html │ └── main.ts │ ├── proxy.conf.json │ ├── e2e │ ├── tsconfig.e2e.json │ ├── app.po.ts │ └── app.e2e-spec.ts │ └── .editorconfig ├── action ├── stock │ ├── src │ │ ├── assets │ │ │ ├── .gitkeep │ │ │ └── img │ │ │ │ └── user2-160x160.jpg │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── footer │ │ │ │ ├── footer.component.css │ │ │ │ ├── footer.component.html │ │ │ │ └── footer.component.ts │ │ │ ├── header │ │ │ │ └── header.component.css │ │ │ ├── menu │ │ │ │ └── menu.component.css │ │ │ ├── stars │ │ │ │ ├── stars.component.css │ │ │ │ └── stars.component.html │ │ │ ├── content │ │ │ │ └── content.component.css │ │ │ ├── sidebar │ │ │ │ ├── sidebar.component.css │ │ │ │ └── sidebar.component.ts │ │ │ ├── dashboard │ │ │ │ ├── dashboard.component.css │ │ │ │ ├── dashboard.component.html │ │ │ │ └── dashboard.component.ts │ │ │ ├── stock │ │ │ │ ├── stock-form │ │ │ │ │ └── stock-form.component.css │ │ │ │ ├── stock-manage │ │ │ │ │ └── stock-manage.component.css │ │ │ │ ├── stock-filter.pipe.spec.ts │ │ │ │ └── stock.service.spec.ts │ │ │ └── app.component.ts │ │ ├── favicon.ico │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ ├── environment.test.ts │ │ │ └── environment.ts │ │ ├── typings.d.ts │ │ ├── styles.css │ │ ├── tsconfig.app.json │ │ ├── main.ts │ │ ├── index.html │ │ └── tsconfig.spec.json │ ├── proxy.conf.json │ ├── e2e │ │ ├── tsconfig.e2e.json │ │ ├── app.po.ts │ │ └── app.e2e-spec.ts │ └── .editorconfig ├── stock-server.zip └── stock-server │ ├── client │ ├── favicon.ico │ ├── assets │ │ └── img │ │ │ └── user2-160x160.jpg │ ├── boxed-bg.7799dece2c79854f63f0.jpg │ ├── glyphicons-halflings-regular.e18bbf611f2a2e43afc0.ttf │ ├── glyphicons-halflings-regular.f4769f9bdb7466be6508.eot │ ├── glyphicons-halflings-regular.448c34a56d699c29117a.woff2 │ └── glyphicons-halflings-regular.fa2772327f55d8198301.woff │ └── tsconfig.json ├── ch2 ├── auction │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── footer │ │ │ │ ├── footer.component.css │ │ │ │ ├── footer.component.html │ │ │ │ └── footer.component.ts │ │ │ ├── navbar │ │ │ │ ├── navbar.component.css │ │ │ │ └── navbar.component.ts │ │ │ ├── search │ │ │ │ ├── search.component.css │ │ │ │ └── search.component.ts │ │ │ ├── stars │ │ │ │ ├── stars.component.css │ │ │ │ └── stars.component.html │ │ │ ├── product │ │ │ │ └── product.component.css │ │ │ ├── app.component.css │ │ │ ├── carousel │ │ │ │ ├── carousel.component.css │ │ │ │ └── carousel.component.ts │ │ │ └── app.component.ts │ │ ├── favicon.ico │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── index.html │ │ └── main.ts │ ├── proxy.conf.json │ ├── e2e │ │ ├── tsconfig.e2e.json │ │ ├── app.po.ts │ │ └── app.e2e-spec.ts │ └── .editorconfig ├── start │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ └── app.component.ts │ │ ├── favicon.ico │ │ ├── styles.css │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── index.html │ │ └── main.ts │ ├── proxy.conf.json │ ├── e2e │ │ ├── tsconfig.e2e.json │ │ ├── app.po.ts │ │ └── app.e2e-spec.ts │ └── .editorconfig └── stock │ ├── src │ ├── assets │ │ ├── .gitkeep │ │ └── img │ │ │ └── user2-160x160.jpg │ ├── app │ │ ├── app.component.css │ │ ├── menu │ │ │ └── menu.component.css │ │ ├── stars │ │ │ ├── stars.component.css │ │ │ └── stars.component.html │ │ ├── content │ │ │ └── content.component.css │ │ ├── footer │ │ │ ├── footer.component.css │ │ │ ├── footer.component.html │ │ │ └── footer.component.ts │ │ ├── header │ │ │ └── header.component.css │ │ ├── sidebar │ │ │ ├── sidebar.component.css │ │ │ └── sidebar.component.ts │ │ ├── dashboard │ │ │ ├── dashboard.component.css │ │ │ ├── dashboard.component.html │ │ │ └── dashboard.component.ts │ │ ├── stock │ │ │ ├── stock-form │ │ │ │ └── stock-form.component.css │ │ │ ├── stock-manage │ │ │ │ └── stock-manage.component.css │ │ │ ├── stock-filter.pipe.spec.ts │ │ │ └── stock.service.spec.ts │ │ └── app.component.ts │ ├── favicon.ico │ ├── environments │ │ ├── environment.prod.ts │ │ ├── environment.test.ts │ │ └── environment.ts │ ├── typings.d.ts │ ├── styles.css │ ├── tsconfig.app.json │ ├── main.ts │ ├── index.html │ └── tsconfig.spec.json │ ├── proxy.conf.json │ ├── e2e │ ├── tsconfig.e2e.json │ ├── app.po.ts │ └── app.e2e-spec.ts │ └── .editorconfig ├── ch3 ├── auction │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── footer │ │ │ │ ├── footer.component.css │ │ │ │ ├── footer.component.html │ │ │ │ └── footer.component.ts │ │ │ ├── navbar │ │ │ │ ├── navbar.component.css │ │ │ │ └── navbar.component.ts │ │ │ ├── search │ │ │ │ ├── search.component.css │ │ │ │ └── search.component.ts │ │ │ ├── stars │ │ │ │ ├── stars.component.css │ │ │ │ └── stars.component.html │ │ │ ├── product │ │ │ │ └── product.component.css │ │ │ ├── carousel │ │ │ │ ├── carousel.component.css │ │ │ │ └── carousel.component.ts │ │ │ ├── home │ │ │ │ ├── home.component.css │ │ │ │ ├── home.component.html │ │ │ │ └── home.component.ts │ │ │ ├── product-detail │ │ │ │ └── product-detail.component.css │ │ │ ├── app.component.ts │ │ │ └── app.component.html │ │ ├── favicon.ico │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── index.html │ │ └── main.ts │ ├── proxy.conf.json │ ├── e2e │ │ ├── tsconfig.e2e.json │ │ ├── app.po.ts │ │ └── app.e2e-spec.ts │ └── .editorconfig └── router │ ├── src │ ├── assets │ │ └── .gitkeep │ ├── app │ │ ├── app.component.css │ │ ├── code404 │ │ │ ├── code404.component.css │ │ │ ├── code404.component.html │ │ │ └── code404.component.ts │ │ ├── product │ │ │ ├── product.component.css │ │ │ ├── product-desc │ │ │ │ ├── product-desc.component.css │ │ │ │ ├── product-desc.component.html │ │ │ │ └── product-desc.component.ts │ │ │ ├── seller-info │ │ │ │ ├── seller-info.component.css │ │ │ │ └── seller-info.component.html │ │ │ └── product.component.html │ │ ├── chat │ │ │ ├── chat.component.html │ │ │ ├── chat.component.css │ │ │ └── chat.component.ts │ │ ├── home │ │ │ ├── home.component.html │ │ │ ├── home.component.css │ │ │ └── home.component.ts │ │ ├── guard │ │ │ └── unsaved.guard.ts │ │ └── app.component.html │ ├── favicon.ico │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── styles.css │ ├── index.html │ └── main.ts │ ├── proxy.conf.json │ ├── e2e │ ├── tsconfig.e2e.json │ ├── app.po.ts │ └── app.e2e-spec.ts │ └── .editorconfig ├── ch6 ├── auction │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── footer │ │ │ │ ├── footer.component.css │ │ │ │ ├── footer.component.html │ │ │ │ └── footer.component.ts │ │ │ ├── navbar │ │ │ │ ├── navbar.component.css │ │ │ │ └── navbar.component.ts │ │ │ ├── search │ │ │ │ ├── search.component.css │ │ │ │ └── search.component.ts │ │ │ ├── stars │ │ │ │ ├── stars.component.css │ │ │ │ └── stars.component.html │ │ │ ├── product │ │ │ │ └── product.component.css │ │ │ ├── carousel │ │ │ │ ├── carousel.component.css │ │ │ │ └── carousel.component.ts │ │ │ ├── home │ │ │ │ ├── home.component.css │ │ │ │ ├── home.component.html │ │ │ │ └── home.component.ts │ │ │ ├── product-detail │ │ │ │ └── product-detail.component.css │ │ │ ├── app.component.ts │ │ │ ├── app.component.html │ │ │ └── pipe │ │ │ │ └── filter.pipe.spec.ts │ │ ├── favicon.ico │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── index.html │ │ └── main.ts │ ├── proxy.conf.json │ ├── e2e │ │ ├── tsconfig.e2e.json │ │ ├── app.po.ts │ │ └── app.e2e-spec.ts │ └── .editorconfig ├── demo1 │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── order │ │ │ │ ├── order.component.css │ │ │ │ └── order.component.html │ │ │ ├── price-quote │ │ │ │ ├── price-quote.component.css │ │ │ │ └── price-quote.component.html │ │ │ └── app.component.html │ │ ├── favicon.ico │ │ ├── styles.css │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── index.html │ │ └── main.ts │ ├── proxy.conf.json │ ├── e2e │ │ ├── tsconfig.e2e.json │ │ ├── app.po.ts │ │ └── app.e2e-spec.ts │ └── .editorconfig ├── demo2 │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── life │ │ │ │ ├── life.component.css │ │ │ │ └── life.component.html │ │ │ ├── app.component.css │ │ │ ├── child │ │ │ │ ├── child.component.css │ │ │ │ └── child.component.html │ │ │ ├── app.component.html │ │ │ └── app.component.ts │ │ ├── favicon.ico │ │ ├── styles.css │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── index.html │ │ └── main.ts │ ├── proxy.conf.json │ ├── e2e │ │ ├── tsconfig.e2e.json │ │ ├── app.po.ts │ │ └── app.e2e-spec.ts │ └── .editorconfig ├── demo3 │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── child │ │ │ │ ├── child.component.css │ │ │ │ └── child.component.html │ │ │ └── app.component.html │ │ ├── favicon.ico │ │ ├── styles.css │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── index.html │ │ └── main.ts │ ├── proxy.conf.json │ ├── e2e │ │ ├── tsconfig.e2e.json │ │ ├── app.po.ts │ │ └── app.e2e-spec.ts │ └── .editorconfig └── demo4 │ ├── src │ ├── assets │ │ └── .gitkeep │ ├── app │ │ ├── child2 │ │ │ ├── child2.component.css │ │ │ ├── child2.component.html │ │ │ └── child2.component.ts │ │ ├── child │ │ │ ├── child.component.html │ │ │ └── child.component.css │ │ ├── app.component.css │ │ └── app.component.html │ ├── favicon.ico │ ├── styles.css │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── index.html │ └── main.ts │ ├── proxy.conf.json │ ├── e2e │ ├── tsconfig.e2e.json │ ├── app.po.ts │ └── app.e2e-spec.ts │ └── .editorconfig ├── ch8 ├── auction │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── footer │ │ │ │ ├── footer.component.css │ │ │ │ ├── footer.component.html │ │ │ │ └── footer.component.ts │ │ │ ├── navbar │ │ │ │ ├── navbar.component.css │ │ │ │ └── navbar.component.ts │ │ │ ├── search │ │ │ │ └── search.component.css │ │ │ ├── stars │ │ │ │ ├── stars.component.css │ │ │ │ └── stars.component.html │ │ │ ├── product │ │ │ │ └── product.component.css │ │ │ ├── carousel │ │ │ │ ├── carousel.component.css │ │ │ │ └── carousel.component.ts │ │ │ ├── home │ │ │ │ ├── home.component.css │ │ │ │ ├── home.component.html │ │ │ │ └── home.component.ts │ │ │ ├── product-detail │ │ │ │ └── product-detail.component.css │ │ │ ├── app.component.ts │ │ │ ├── app.component.html │ │ │ └── pipe │ │ │ │ └── filter.pipe.spec.ts │ │ ├── favicon.ico │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ ├── environment.test.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── index.html │ │ └── main.ts │ ├── proxy.conf.json │ ├── e2e │ │ ├── tsconfig.e2e.json │ │ ├── app.po.ts │ │ └── app.e2e-spec.ts │ └── .editorconfig ├── client │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── product │ │ │ │ ├── product.component.css │ │ │ │ └── product.component.html │ │ │ ├── web-socket │ │ │ │ ├── web-socket.component.css │ │ │ │ └── web-socket.component.html │ │ │ ├── app.component.html │ │ │ └── app.component.ts │ │ ├── favicon.ico │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── index.html │ │ └── main.ts │ ├── proxy.conf.json │ ├── e2e │ │ ├── tsconfig.e2e.json │ │ ├── app.po.ts │ │ └── app.e2e-spec.ts │ └── .editorconfig ├── demo1 │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── product │ │ │ │ ├── product.component.css │ │ │ │ └── product.component.html │ │ │ ├── socket │ │ │ │ ├── socket.component.css │ │ │ │ └── socket.component.html │ │ │ ├── observable │ │ │ │ ├── observable.component.css │ │ │ │ └── observable.component.html │ │ │ ├── app.component.html │ │ │ ├── app.component.ts │ │ │ └── shared │ │ │ │ └── observable.service.ts │ │ ├── favicon.ico │ │ ├── styles.css │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── index.html │ │ └── main.ts │ ├── proxy.conf.json │ ├── e2e │ │ ├── tsconfig.e2e.json │ │ ├── app.po.ts │ │ └── app.e2e-spec.ts │ └── .editorconfig └── server │ ├── server │ └── hello_server.ts │ ├── .idea │ ├── typescript-compiler.xml │ └── modules.xml │ ├── tsconfig.json │ └── build │ └── hello_server.js ├── ch9 ├── auction │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── footer │ │ │ │ ├── footer.component.css │ │ │ │ ├── footer.component.html │ │ │ │ └── footer.component.ts │ │ │ ├── navbar │ │ │ │ ├── navbar.component.css │ │ │ │ └── navbar.component.ts │ │ │ ├── search │ │ │ │ └── search.component.css │ │ │ ├── stars │ │ │ │ ├── stars.component.css │ │ │ │ └── stars.component.html │ │ │ ├── product │ │ │ │ └── product.component.css │ │ │ ├── carousel │ │ │ │ ├── carousel.component.css │ │ │ │ └── carousel.component.ts │ │ │ ├── home │ │ │ │ ├── home.component.css │ │ │ │ ├── home.component.html │ │ │ │ └── home.component.ts │ │ │ ├── product-detail │ │ │ │ └── product-detail.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.ts │ │ │ └── pipe │ │ │ │ └── filter.pipe.spec.ts │ │ ├── favicon.ico │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── typings.d.ts │ │ ├── tsconfig.app.json │ │ ├── index.html │ │ ├── main.ts │ │ └── tsconfig.spec.json │ ├── proxy.conf.json │ ├── e2e │ │ ├── tsconfig.e2e.json │ │ ├── app.po.ts │ │ └── app.e2e-spec.ts │ └── .editorconfig └── server │ ├── client │ ├── favicon.ico │ ├── glyphicons-halflings-regular.e18bbf611f2a2e43afc0.ttf │ ├── glyphicons-halflings-regular.f4769f9bdb7466be6508.eot │ ├── glyphicons-halflings-regular.fa2772327f55d8198301.woff │ └── glyphicons-halflings-regular.448c34a56d699c29117a.woff2 │ ├── server │ └── hello_server.ts │ ├── .idea │ ├── typescript-compiler.xml │ └── modules.xml │ ├── tsconfig.json │ └── build │ └── hello_server.js ├── README.md ├── action.zip └── angular入门实战.pptx /ch4/di/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch5/bind/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch7/demo/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /action/stock/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch2/auction/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch2/start/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch2/stock/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch3/auction/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch3/router/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch4/auction/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch4/di/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch5/auction/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch5/demo1/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch6/auction/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch6/demo1/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch6/demo2/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch6/demo3/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch6/demo4/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch7/auction/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch7/demo1/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch8/auction/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch8/client/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch8/demo1/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch9/auction/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /action/stock/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch2/start/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch2/stock/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch3/auction/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch3/router/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch4/auction/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch5/auction/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch5/bind/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch6/auction/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch6/demo1/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch6/demo3/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch7/auction/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch7/demo/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch7/demo1/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch8/auction/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch8/client/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch8/demo1/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch9/auction/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # angular4 2 | angular4入门与实战 3 | -------------------------------------------------------------------------------- /ch2/stock/src/app/menu/menu.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch2/stock/src/app/stars/stars.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch5/bind/src/app/order/order.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch5/demo1/src/app/life/life.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch6/demo1/src/app/order/order.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch6/demo2/src/app/life/life.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch6/demo3/src/app/child/child.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /action/stock/src/app/footer/footer.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /action/stock/src/app/header/header.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /action/stock/src/app/menu/menu.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /action/stock/src/app/stars/stars.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch2/auction/src/app/footer/footer.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch2/auction/src/app/navbar/navbar.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch2/auction/src/app/search/search.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch2/auction/src/app/stars/stars.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch2/stock/src/app/content/content.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch2/stock/src/app/footer/footer.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch2/stock/src/app/header/header.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch2/stock/src/app/sidebar/sidebar.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch3/auction/src/app/footer/footer.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch3/auction/src/app/navbar/navbar.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch3/auction/src/app/search/search.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch3/auction/src/app/stars/stars.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch3/router/src/app/code404/code404.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch3/router/src/app/product/product.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch4/auction/src/app/footer/footer.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch4/auction/src/app/navbar/navbar.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch4/auction/src/app/search/search.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch4/auction/src/app/stars/stars.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch4/di/src/app/product1/product1.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch4/di/src/app/product2/product2.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch5/auction/src/app/footer/footer.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch5/auction/src/app/navbar/navbar.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch5/auction/src/app/search/search.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch5/auction/src/app/stars/stars.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch5/bind/src/app/search/search.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch5/demo1/src/app/change/change.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch5/demo1/src/app/child1/child1.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch5/demo1/src/app/footer/footer.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch5/demo1/src/app/header/header.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch6/auction/src/app/footer/footer.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch6/auction/src/app/navbar/navbar.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch6/auction/src/app/search/search.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch6/auction/src/app/stars/stars.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch6/demo4/src/app/child2/child2.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch7/auction/src/app/footer/footer.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch7/auction/src/app/navbar/navbar.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch7/auction/src/app/search/search.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch7/auction/src/app/stars/stars.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch8/auction/src/app/footer/footer.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch8/auction/src/app/navbar/navbar.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch8/auction/src/app/search/search.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch8/auction/src/app/stars/stars.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch8/client/src/app/product/product.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch8/demo1/src/app/product/product.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch8/demo1/src/app/socket/socket.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch9/auction/src/app/footer/footer.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch9/auction/src/app/navbar/navbar.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch9/auction/src/app/search/search.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch9/auction/src/app/stars/stars.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /action/stock/src/app/content/content.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /action/stock/src/app/sidebar/sidebar.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch2/auction/src/app/product/product.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch2/stock/src/app/dashboard/dashboard.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch3/auction/src/app/product/product.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch4/auction/src/app/product/product.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch5/auction/src/app/product/product.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch6/auction/src/app/product/product.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch7/auction/src/app/product/product.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch7/demo1/src/app/reactive/reactive.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch8/auction/src/app/product/product.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch8/demo1/src/app/observable/observable.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch9/auction/src/app/product/product.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /action/stock/src/app/dashboard/dashboard.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch5/bind/src/app/price-quote/price-quote.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch6/demo1/src/app/price-quote/price-quote.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch7/demo/src/app/reactive-form/reactive-form.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch7/demo/src/app/template-form/template-form.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch8/client/src/app/web-socket/web-socket.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /action/stock/src/app/stock/stock-form/stock-form.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch2/stock/src/app/stock/stock-form/stock-form.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch2/stock/src/app/stock/stock-manage/stock-manage.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /action/stock/src/app/stock/stock-manage/stock-manage.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch3/router/src/app/product/product-desc/product-desc.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch3/router/src/app/product/seller-info/seller-info.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch6/demo4/src/app/child/child.component.html: -------------------------------------------------------------------------------- 1 |
child1
2 | -------------------------------------------------------------------------------- /action.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/action.zip -------------------------------------------------------------------------------- /ch2/start/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

2 | {{title}} 3 |

4 | -------------------------------------------------------------------------------- /ch5/demo1/src/app/life/life.component.html: -------------------------------------------------------------------------------- 1 |

2 | life works! 3 |

4 | -------------------------------------------------------------------------------- /ch6/demo2/src/app/life/life.component.html: -------------------------------------------------------------------------------- 1 |

2 | life works! 3 |

4 | -------------------------------------------------------------------------------- /ch8/client/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ch5/demo1/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | .wrapper { 2 | background: cyan; 3 | } 4 | -------------------------------------------------------------------------------- /ch5/demo1/src/app/child1/child1.component.html: -------------------------------------------------------------------------------- 1 |

2 | child1 works! 3 |

4 | -------------------------------------------------------------------------------- /ch5/demo1/src/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
这是页脚,这个div是父组件投影到子组件的
2 | -------------------------------------------------------------------------------- /ch6/demo2/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | .parent { 2 | background: cyan; 3 | } 4 | -------------------------------------------------------------------------------- /ch6/demo3/src/app/child/child.component.html: -------------------------------------------------------------------------------- 1 |

2 | child works! 3 |

4 | -------------------------------------------------------------------------------- /ch6/demo4/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | .wrapper { 2 | background: cyan; 3 | } 4 | -------------------------------------------------------------------------------- /ch6/demo4/src/app/child2/child2.component.html: -------------------------------------------------------------------------------- 1 |

2 | child2 works! 3 |

4 | -------------------------------------------------------------------------------- /angular入门实战.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/angular入门实战.pptx -------------------------------------------------------------------------------- /ch3/router/src/app/code404/code404.component.html: -------------------------------------------------------------------------------- 1 |

2 | code404 works! 3 |

4 | -------------------------------------------------------------------------------- /ch2/stock/src/app/dashboard/dashboard.component.html: -------------------------------------------------------------------------------- 1 |

2 | dashboard works! 3 |

4 | -------------------------------------------------------------------------------- /ch6/demo2/src/app/child/child.component.css: -------------------------------------------------------------------------------- 1 | .child { 2 | background: lightgreen; 3 | } 4 | -------------------------------------------------------------------------------- /action/stock/src/app/dashboard/dashboard.component.html: -------------------------------------------------------------------------------- 1 |

2 | dashboard works! 3 |

4 | -------------------------------------------------------------------------------- /ch2/auction/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | .carousel-container { 2 | margin-bottom: 20px; 3 | } 4 | -------------------------------------------------------------------------------- /ch2/auction/src/app/carousel/carousel.component.css: -------------------------------------------------------------------------------- 1 | .slide-image { 2 | width: 100%; 3 | } 4 | -------------------------------------------------------------------------------- /ch3/auction/src/app/carousel/carousel.component.css: -------------------------------------------------------------------------------- 1 | .slide-image { 2 | width: 100%; 3 | } 4 | -------------------------------------------------------------------------------- /ch3/router/src/app/product/product-desc/product-desc.component.html: -------------------------------------------------------------------------------- 1 |

2 | 这是商品描述 3 |

4 | -------------------------------------------------------------------------------- /ch4/auction/src/app/carousel/carousel.component.css: -------------------------------------------------------------------------------- 1 | .slide-image { 2 | width: 100%; 3 | } 4 | -------------------------------------------------------------------------------- /ch4/di/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api":{ 3 | "target":"http://localhost:3000" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch4/di/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch4/di/src/favicon.ico -------------------------------------------------------------------------------- /ch5/auction/src/app/carousel/carousel.component.css: -------------------------------------------------------------------------------- 1 | .slide-image { 2 | width: 100%; 3 | } 4 | -------------------------------------------------------------------------------- /ch5/demo1/src/app/child/child.component.css: -------------------------------------------------------------------------------- 1 | .wrapper { 2 | background: lightgreen; 3 | } 4 | -------------------------------------------------------------------------------- /ch5/demo1/src/app/header/header.component.html: -------------------------------------------------------------------------------- 1 |
这是页头,这个div是父组件投影到子组件的,参数是{{param}}
2 | -------------------------------------------------------------------------------- /ch6/auction/src/app/carousel/carousel.component.css: -------------------------------------------------------------------------------- 1 | .slide-image { 2 | width: 100%; 3 | } 4 | -------------------------------------------------------------------------------- /ch6/demo4/src/app/child/child.component.css: -------------------------------------------------------------------------------- 1 | .wrapper { 2 | background: lightgreen; 3 | } 4 | -------------------------------------------------------------------------------- /ch7/auction/src/app/carousel/carousel.component.css: -------------------------------------------------------------------------------- 1 | .slide-image { 2 | width: 100%; 3 | } 4 | -------------------------------------------------------------------------------- /ch7/demo1/src/app/regist1/regist1.component.css: -------------------------------------------------------------------------------- 1 | .hasError { 2 | border: 1px solid red; 3 | } 4 | -------------------------------------------------------------------------------- /ch8/auction/src/app/carousel/carousel.component.css: -------------------------------------------------------------------------------- 1 | .slide-image { 2 | width: 100%; 3 | } 4 | -------------------------------------------------------------------------------- /ch9/auction/src/app/carousel/carousel.component.css: -------------------------------------------------------------------------------- 1 | .slide-image { 2 | width: 100%; 3 | } 4 | -------------------------------------------------------------------------------- /action/stock-server.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/action/stock-server.zip -------------------------------------------------------------------------------- /ch2/auction/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api":{ 3 | "target":"http://localhost:3000" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch2/start/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api":{ 3 | "target":"http://localhost:3000" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch2/start/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch2/start/src/favicon.ico -------------------------------------------------------------------------------- /ch2/stock/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api":{ 3 | "target":"http://localhost:8000" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch2/stock/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch2/stock/src/favicon.ico -------------------------------------------------------------------------------- /ch3/auction/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api":{ 3 | "target":"http://localhost:3000" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch3/auction/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | .carousel-container { 2 | margin-bottom: 20px; 3 | } 4 | -------------------------------------------------------------------------------- /ch3/router/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api":{ 3 | "target":"http://localhost:3000" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch4/auction/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api":{ 3 | "target":"http://localhost:3000" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch4/auction/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | .carousel-container { 2 | margin-bottom: 20px; 3 | } 4 | -------------------------------------------------------------------------------- /ch5/auction/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api":{ 3 | "target":"http://localhost:3000" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch5/auction/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | .carousel-container { 2 | margin-bottom: 20px; 3 | } 4 | -------------------------------------------------------------------------------- /ch5/bind/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api":{ 3 | "target":"http://localhost:3000" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch5/bind/src/app/order/order.component.html: -------------------------------------------------------------------------------- 1 |
2 | 买 {{amount}} 手 {{stockCode}} 股票 3 |
4 | -------------------------------------------------------------------------------- /ch5/bind/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch5/bind/src/favicon.ico -------------------------------------------------------------------------------- /ch5/demo1/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api":{ 3 | "target":"http://localhost:3000" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch5/demo1/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch5/demo1/src/favicon.ico -------------------------------------------------------------------------------- /ch6/auction/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api":{ 3 | "target":"http://localhost:3000" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch6/auction/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | .carousel-container { 2 | margin-bottom: 20px; 3 | } 4 | -------------------------------------------------------------------------------- /ch6/demo1/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api":{ 3 | "target":"http://localhost:3000" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch6/demo1/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch6/demo1/src/favicon.ico -------------------------------------------------------------------------------- /ch6/demo2/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api":{ 3 | "target":"http://localhost:3000" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch6/demo2/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch6/demo2/src/favicon.ico -------------------------------------------------------------------------------- /ch6/demo3/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api":{ 3 | "target":"http://localhost:3000" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch6/demo3/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch6/demo3/src/favicon.ico -------------------------------------------------------------------------------- /ch6/demo4/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api":{ 3 | "target":"http://localhost:3000" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch6/demo4/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch6/demo4/src/favicon.ico -------------------------------------------------------------------------------- /ch7/auction/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api":{ 3 | "target":"http://localhost:3000" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch7/auction/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | .carousel-container { 2 | margin-bottom: 20px; 3 | } 4 | -------------------------------------------------------------------------------- /ch7/demo/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api":{ 3 | "target":"http://localhost:3000" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch7/demo/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch7/demo/src/favicon.ico -------------------------------------------------------------------------------- /ch7/demo1/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api":{ 3 | "target":"http://localhost:3000" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch7/demo1/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch7/demo1/src/favicon.ico -------------------------------------------------------------------------------- /ch8/auction/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api":{ 3 | "target":"http://localhost:3000" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch8/auction/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | .carousel-container { 2 | margin-bottom: 20px; 3 | } 4 | -------------------------------------------------------------------------------- /ch8/client/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api":{ 3 | "target":"http://localhost:3000" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch8/demo1/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api":{ 3 | "target":"http://localhost:3000" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch8/demo1/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch8/demo1/src/favicon.ico -------------------------------------------------------------------------------- /ch9/auction/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api":{ 3 | "target":"http://localhost:3000" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch9/auction/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | .carousel-container { 2 | margin-bottom: 20px; 3 | } 4 | -------------------------------------------------------------------------------- /action/stock/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api":{ 3 | "target":"http://localhost:8000" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /ch2/auction/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch2/auction/src/favicon.ico -------------------------------------------------------------------------------- /ch2/start/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /ch3/auction/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch3/auction/src/favicon.ico -------------------------------------------------------------------------------- /ch3/router/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch3/router/src/favicon.ico -------------------------------------------------------------------------------- /ch4/auction/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch4/auction/src/favicon.ico -------------------------------------------------------------------------------- /ch4/di/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /ch4/di/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /ch5/auction/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch5/auction/src/favicon.ico -------------------------------------------------------------------------------- /ch5/bind/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /ch5/bind/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /ch5/demo1/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /ch6/auction/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch6/auction/src/favicon.ico -------------------------------------------------------------------------------- /ch6/demo1/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /ch6/demo2/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /ch6/demo3/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /ch6/demo4/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /ch7/auction/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch7/auction/src/favicon.ico -------------------------------------------------------------------------------- /ch7/demo/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /ch7/demo/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /ch7/demo1/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /ch8/auction/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch8/auction/src/favicon.ico -------------------------------------------------------------------------------- /ch8/client/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch8/client/src/favicon.ico -------------------------------------------------------------------------------- /ch8/demo1/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /ch9/auction/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch9/auction/src/favicon.ico -------------------------------------------------------------------------------- /action/stock/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/action/stock/src/favicon.ico -------------------------------------------------------------------------------- /ch2/auction/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /ch2/start/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /ch3/auction/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /ch3/router/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /ch3/router/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /ch4/auction/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /ch5/auction/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /ch5/demo1/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /ch6/auction/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /ch6/demo1/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /ch6/demo2/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /ch6/demo3/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /ch6/demo4/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /ch7/auction/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /ch7/demo/src/app/reactive-regist/reactive-regist.component.css: -------------------------------------------------------------------------------- 1 | .hasError { 2 | border: 1px solid red; 3 | } 4 | -------------------------------------------------------------------------------- /ch7/demo1/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /ch8/auction/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /ch8/auction/src/environments/environment.test.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /ch8/client/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /ch8/client/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /ch8/demo1/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /ch9/auction/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /ch9/server/client/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch9/server/client/favicon.ico -------------------------------------------------------------------------------- /ch8/client/src/app/web-socket/web-socket.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ch8/demo1/src/app/observable/observable.component.html: -------------------------------------------------------------------------------- 1 |
2 | 当前时间{{currentTime | date:'jms'}} 3 |
4 | -------------------------------------------------------------------------------- /ch3/auction/src/app/product-detail/product-detail.component.css: -------------------------------------------------------------------------------- 1 | .productDetailContainer { 2 | padding: 20px; 3 | } 4 | -------------------------------------------------------------------------------- /ch3/router/src/app/chat/chat.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ch3/router/src/app/product/seller-info/seller-info.component.html: -------------------------------------------------------------------------------- 1 |

2 | 这里是销售员信息! 销售员ID是{{sellerId}} 3 |

4 | 5 | -------------------------------------------------------------------------------- /ch4/auction/src/app/product-detail/product-detail.component.css: -------------------------------------------------------------------------------- 1 | .productDetailContainer { 2 | padding: 20px; 3 | } 4 | -------------------------------------------------------------------------------- /ch5/auction/src/app/product-detail/product-detail.component.css: -------------------------------------------------------------------------------- 1 | .productDetailContainer { 2 | padding: 20px; 3 | } 4 | -------------------------------------------------------------------------------- /ch6/auction/src/app/product-detail/product-detail.component.css: -------------------------------------------------------------------------------- 1 | .productDetailContainer { 2 | padding: 20px; 3 | } 4 | -------------------------------------------------------------------------------- /ch7/auction/src/app/product-detail/product-detail.component.css: -------------------------------------------------------------------------------- 1 | .productDetailContainer { 2 | padding: 20px; 3 | } 4 | -------------------------------------------------------------------------------- /ch8/auction/src/app/product-detail/product-detail.component.css: -------------------------------------------------------------------------------- 1 | .productDetailContainer { 2 | padding: 20px; 3 | } 4 | -------------------------------------------------------------------------------- /ch9/auction/src/app/product-detail/product-detail.component.css: -------------------------------------------------------------------------------- 1 | .productDetailContainer { 2 | padding: 20px; 3 | } 4 | -------------------------------------------------------------------------------- /action/stock-server/client/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/action/stock-server/client/favicon.ico -------------------------------------------------------------------------------- /ch2/stock/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | appTitle:'生产环境' 4 | }; 5 | -------------------------------------------------------------------------------- /ch2/stock/src/environments/environment.test.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | appTitle:'测试环境' 4 | }; 5 | -------------------------------------------------------------------------------- /action/stock/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | appTitle:'生产环境' 4 | }; 5 | -------------------------------------------------------------------------------- /action/stock/src/environments/environment.test.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | appTitle:'测试环境' 4 | }; 5 | -------------------------------------------------------------------------------- /ch2/stock/src/assets/img/user2-160x160.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch2/stock/src/assets/img/user2-160x160.jpg -------------------------------------------------------------------------------- /action/stock/src/assets/img/user2-160x160.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/action/stock/src/assets/img/user2-160x160.jpg -------------------------------------------------------------------------------- /ch5/bind/src/app/price-quote/price-quote.component.html: -------------------------------------------------------------------------------- 1 |
2 | 这是在报价组件内部,股票代码是{{stockCode}}, 股票价格是{{price | number:'2.2-2'}} 3 |
4 | -------------------------------------------------------------------------------- /action/stock/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /ch2/auction/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | body { 3 | padding-top: 70px; 4 | } 5 | -------------------------------------------------------------------------------- /ch2/stock/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /ch3/auction/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | body { 3 | padding-top: 70px; 4 | } 5 | -------------------------------------------------------------------------------- /ch4/auction/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | body { 3 | padding-top: 70px; 4 | } 5 | -------------------------------------------------------------------------------- /ch5/auction/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | body { 3 | padding-top: 70px; 4 | } 5 | -------------------------------------------------------------------------------- /ch5/bind/src/app/search/search.component.html: -------------------------------------------------------------------------------- 1 |

2 | 响应式编程Demo 3 |

4 | 5 | -------------------------------------------------------------------------------- /ch6/auction/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | body { 3 | padding-top: 70px; 4 | } 5 | -------------------------------------------------------------------------------- /ch7/auction/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | body { 3 | padding-top: 70px; 4 | } 5 | -------------------------------------------------------------------------------- /ch8/auction/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | body { 3 | padding-top: 70px; 4 | } 5 | -------------------------------------------------------------------------------- /ch8/demo1/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /ch9/auction/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | body { 3 | padding-top: 70px; 4 | } 5 | -------------------------------------------------------------------------------- /ch9/auction/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /ch6/demo4/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | child1 2 | child2 3 | 4 | -------------------------------------------------------------------------------- /action/stock-server/client/assets/img/user2-160x160.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/action/stock-server/client/assets/img/user2-160x160.jpg -------------------------------------------------------------------------------- /ch3/router/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 |
2 | Home Component 3 | 4 |
5 | -------------------------------------------------------------------------------- /action/stock-server/client/boxed-bg.7799dece2c79854f63f0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/action/stock-server/client/boxed-bg.7799dece2c79854f63f0.jpg -------------------------------------------------------------------------------- /ch5/demo1/src/app/bind/bind.component.css: -------------------------------------------------------------------------------- 1 | .a { 2 | background: yellow; 3 | } 4 | 5 | .b { 6 | color: red; 7 | } 8 | 9 | .c { 10 | font-size: 60px; 11 | } 12 | -------------------------------------------------------------------------------- /ch5/demo1/src/app/bind/bind.component.html: -------------------------------------------------------------------------------- 1 |

2 | 管道Demo 3 |

4 |

我的生日是{{birthday | date}}

5 |

圆周率是{{pi}}

6 |

试试我自己写的管道{{size | multiple:'2'}}

7 | -------------------------------------------------------------------------------- /ch6/demo1/src/app/order/order.component.html: -------------------------------------------------------------------------------- 1 |
2 | 我是下单组件 3 |
4 |
5 | 买100手{{priceQuote.stockCode}}股票,买入价格是{{priceQuote.lastPrice | number:'2.2-2'}} 6 |
7 | -------------------------------------------------------------------------------- /ch8/client/src/app/product/product.component.html: -------------------------------------------------------------------------------- 1 |
2 | 商品信息 3 |
4 | 9 | -------------------------------------------------------------------------------- /ch4/di/src/app/product1/product1.component.html: -------------------------------------------------------------------------------- 1 |
2 |

商品详情

3 |

名称:{{product.title}}

4 |

价格:{{product.price}}

5 |

描述:{{product.desc}}

6 |
7 | -------------------------------------------------------------------------------- /ch4/di/src/app/product2/product2.component.html: -------------------------------------------------------------------------------- 1 |
2 |

商品详情

3 |

名称:{{product.title}}

4 |

价格:{{product.price}}

5 |

描述:{{product.desc}}

6 |
7 | -------------------------------------------------------------------------------- /ch9/server/client/glyphicons-halflings-regular.e18bbf611f2a2e43afc0.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch9/server/client/glyphicons-halflings-regular.e18bbf611f2a2e43afc0.ttf -------------------------------------------------------------------------------- /ch9/server/client/glyphicons-halflings-regular.f4769f9bdb7466be6508.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch9/server/client/glyphicons-halflings-regular.f4769f9bdb7466be6508.eot -------------------------------------------------------------------------------- /ch9/server/client/glyphicons-halflings-regular.fa2772327f55d8198301.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch9/server/client/glyphicons-halflings-regular.fa2772327f55d8198301.woff -------------------------------------------------------------------------------- /action/stock/src/app/stars/stars.component.html: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /ch2/stock/src/app/stars/stars.component.html: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /ch3/auction/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 | 4 |
5 | 6 |
7 | -------------------------------------------------------------------------------- /ch4/auction/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 | 4 |
5 | 6 |
7 | -------------------------------------------------------------------------------- /ch5/auction/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 | 4 |
5 | 6 |
7 | -------------------------------------------------------------------------------- /ch6/auction/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 | 4 |
5 | 6 |
7 | -------------------------------------------------------------------------------- /ch7/auction/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 | 4 |
5 | 6 |
7 | -------------------------------------------------------------------------------- /ch8/auction/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 | 4 |
5 | 6 |
7 | -------------------------------------------------------------------------------- /ch9/auction/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 | 4 |
5 | 6 |
7 | -------------------------------------------------------------------------------- /ch9/server/client/glyphicons-halflings-regular.448c34a56d699c29117a.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/ch9/server/client/glyphicons-halflings-regular.448c34a56d699c29117a.woff2 -------------------------------------------------------------------------------- /ch6/demo3/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | {{message}} 5 | -------------------------------------------------------------------------------- /action/stock-server/client/glyphicons-halflings-regular.e18bbf611f2a2e43afc0.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/action/stock-server/client/glyphicons-halflings-regular.e18bbf611f2a2e43afc0.ttf -------------------------------------------------------------------------------- /action/stock-server/client/glyphicons-halflings-regular.f4769f9bdb7466be6508.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/action/stock-server/client/glyphicons-halflings-regular.f4769f9bdb7466be6508.eot -------------------------------------------------------------------------------- /action/stock-server/client/glyphicons-halflings-regular.448c34a56d699c29117a.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/action/stock-server/client/glyphicons-halflings-regular.448c34a56d699c29117a.woff2 -------------------------------------------------------------------------------- /action/stock-server/client/glyphicons-halflings-regular.fa2772327f55d8198301.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jojozhai/angular4/HEAD/action/stock-server/client/glyphicons-halflings-regular.fa2772327f55d8198301.woff -------------------------------------------------------------------------------- /ch3/auction/src/app/stars/stars.component.html: -------------------------------------------------------------------------------- 1 |

2 | 4 | {{rating}}星 5 |

6 | -------------------------------------------------------------------------------- /ch4/auction/src/app/stars/stars.component.html: -------------------------------------------------------------------------------- 1 |

2 | 4 | {{rating}}星 5 |

6 | -------------------------------------------------------------------------------- /ch4/di/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

基本的依赖注入样例

4 |
5 |
6 | 7 | 8 |
9 |
10 | -------------------------------------------------------------------------------- /ch5/auction/src/app/stars/stars.component.html: -------------------------------------------------------------------------------- 1 |

2 | 4 | {{rating}}星 5 |

6 | -------------------------------------------------------------------------------- /ch6/demo2/src/app/child/child.component.html: -------------------------------------------------------------------------------- 1 |
2 |

我是子组件

3 |
问候语:{{greeting}}
4 |
姓名:{{user.name}}
5 |
消息:
6 |
7 | -------------------------------------------------------------------------------- /ch3/router/src/app/chat/chat.component.css: -------------------------------------------------------------------------------- 1 | .chat { 2 | background: #eee; 3 | height: 80px; 4 | width: 30%; 5 | font-size: 24px; 6 | float: left; 7 | display: block; 8 | box-sizing: border-box; 9 | } 10 | -------------------------------------------------------------------------------- /ch3/router/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | .home { 2 | background: red; 3 | padding: 15px 0 0 30px; 4 | height: 80px; 5 | width: 70%; 6 | font-size: 30px; 7 | float: left; 8 | box-sizing: border-box; 9 | } 10 | -------------------------------------------------------------------------------- /ch8/demo1/src/app/socket/socket.component.html: -------------------------------------------------------------------------------- 1 |

2 | socket works! 3 |

4 |
5 | {{messageFromServer}} 6 |
7 |
8 | 9 |
10 | -------------------------------------------------------------------------------- /ch5/bind/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 这是在报价组件外部,股票代码是{{priceQuote.stockCode}}, 4 | 股票价格是{{priceQuote.lastPrice | number:'2.2-2'}} 5 |
6 | 7 | -------------------------------------------------------------------------------- /ch5/demo1/src/app/change/change.component.html: -------------------------------------------------------------------------------- 1 |
2 |

Child

3 |
Greeting: {{greeting}}
4 |
User name: {{user.name}}
5 |
Message:
6 |
7 | -------------------------------------------------------------------------------- /ch5/demo1/src/app/child/child.component.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | 我是子组件 4 |

5 | 6 |
这个div定义在子组件中
7 | 8 |
9 | -------------------------------------------------------------------------------- /ch2/auction/src/app/stars/stars.component.html: -------------------------------------------------------------------------------- 1 |

2 | 4 | {{rating}}星 5 |

6 | -------------------------------------------------------------------------------- /ch4/di/src/app/shared/logger.service.ts: -------------------------------------------------------------------------------- 1 | import {Injectable} from "@angular/core"; 2 | 3 | @Injectable() 4 | export class LoggerService { 5 | 6 | constructor() { } 7 | 8 | log(message:string) { 9 | console.log(message); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /ch6/demo1/src/app/price-quote/price-quote.component.html: -------------------------------------------------------------------------------- 1 |
2 | 我是报价组件 3 |
4 |
5 | 股票代码是{{stockCode}},股票价格是{{price | number:'2.2-2'}} 6 |
7 |
8 | 9 |
10 | -------------------------------------------------------------------------------- /ch2/auction/src/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 10 |
11 | -------------------------------------------------------------------------------- /ch3/auction/src/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 10 |
11 | -------------------------------------------------------------------------------- /ch4/auction/src/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 10 |
11 | -------------------------------------------------------------------------------- /ch5/auction/src/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 10 |
11 | -------------------------------------------------------------------------------- /ch6/auction/src/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 10 |
11 | -------------------------------------------------------------------------------- /ch6/auction/src/app/stars/stars.component.html: -------------------------------------------------------------------------------- 1 |

2 | 4 | {{rating | number:'1.0-2'}}星 5 |

6 | -------------------------------------------------------------------------------- /ch7/auction/src/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 10 |
11 | -------------------------------------------------------------------------------- /ch7/auction/src/app/stars/stars.component.html: -------------------------------------------------------------------------------- 1 |

2 | 4 | {{rating | number:'1.0-2'}}星 5 |

6 | -------------------------------------------------------------------------------- /ch8/auction/src/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 10 |
11 | -------------------------------------------------------------------------------- /ch8/auction/src/app/stars/stars.component.html: -------------------------------------------------------------------------------- 1 |

2 | 4 | {{rating | number:'1.0-2'}}星 5 |

6 | -------------------------------------------------------------------------------- /ch8/server/server/hello_server.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by zhailiang on 2017/2/18. 3 | */ 4 | import * as http from 'http' 5 | 6 | const server = http.createServer((request, response) => { 7 | response.end("Hello Node!"); 8 | }); 9 | 10 | server.listen(8000); -------------------------------------------------------------------------------- /ch9/auction/src/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 10 |
11 | -------------------------------------------------------------------------------- /ch9/auction/src/app/stars/stars.component.html: -------------------------------------------------------------------------------- 1 |

2 | 4 | {{rating | number:'1.0-2'}}星 5 |

6 | -------------------------------------------------------------------------------- /ch9/server/server/hello_server.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by zhailiang on 2017/2/18. 3 | */ 4 | import * as http from 'http' 5 | 6 | const server = http.createServer((request, response) => { 7 | response.end("Hello Node!"); 8 | }); 9 | 10 | server.listen(8000); -------------------------------------------------------------------------------- /ch4/di/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /action/stock/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch2/auction/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch2/start/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch2/stock/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch3/auction/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch3/router/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch4/auction/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch5/auction/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch5/bind/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch5/demo1/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch6/auction/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch6/demo1/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch6/demo2/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch6/demo3/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch6/demo4/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch7/auction/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch7/demo/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch7/demo1/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch8/auction/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch8/client/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch8/demo1/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch8/server/.idea/typescript-compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /ch9/auction/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types":[ 8 | "jasmine", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch9/server/.idea/typescript-compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /action/stock/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class StockPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /action/stock/src/app/stock/stock-filter.pipe.spec.ts: -------------------------------------------------------------------------------- 1 | import { StockFilterPipe } from './stock-filter.pipe'; 2 | 3 | describe('StockFilterPipe', () => { 4 | it('create an instance', () => { 5 | const pipe = new StockFilterPipe(); 6 | expect(pipe).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /ch2/start/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class Auction4Page { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch2/stock/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class StockPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch2/stock/src/app/stock/stock-filter.pipe.spec.ts: -------------------------------------------------------------------------------- 1 | import { StockFilterPipe } from './stock-filter.pipe'; 2 | 3 | describe('StockFilterPipe', () => { 4 | it('create an instance', () => { 5 | const pipe = new StockFilterPipe(); 6 | expect(pipe).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /ch3/router/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class Auction4Page { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch4/di/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class Auction4Page { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch5/bind/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class Auction4Page { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch5/demo1/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class Auction4Page { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch6/demo1/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class Auction4Page { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch6/demo2/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class Auction4Page { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch6/demo3/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class Auction4Page { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch6/demo4/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class Auction4Page { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch7/demo/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class Auction4Page { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch7/demo1/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class Auction4Page { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch8/client/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class Auction4Page { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch8/demo1/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class Auction4Page { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch2/auction/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class Auction4Page { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch2/stock/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | @import "~https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css"; 3 | @import "~https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css"; 4 | -------------------------------------------------------------------------------- /ch3/auction/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class Auction4Page { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch3/router/src/app/product/product.component.html: -------------------------------------------------------------------------------- 1 |

2 | 商品信息 3 |

4 |

5 | 商品ID是 {{productId}} 6 |

7 |

8 | test is {{test}} 9 |

10 | 商品描述 11 | 销售员信息 12 | 13 | -------------------------------------------------------------------------------- /ch4/auction/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class Auction4Page { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch4/di/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import {Component} from "@angular/core"; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'app works!'; 10 | } 11 | -------------------------------------------------------------------------------- /ch5/auction/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class Auction4Page { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch6/auction/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class Auction4Page { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch7/auction/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class Auction4Page { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch7/demo/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'app works!'; 10 | } 11 | -------------------------------------------------------------------------------- /ch8/auction/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class Auction4Page { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch9/auction/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class Auction4Page { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /action/stock/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'app works!'; 10 | } 11 | -------------------------------------------------------------------------------- /action/stock/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | @import "~https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css"; 3 | @import "~https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css"; 4 | -------------------------------------------------------------------------------- /ch2/start/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'app works!'; 10 | } 11 | -------------------------------------------------------------------------------- /ch2/stock/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'app works!'; 10 | } 11 | -------------------------------------------------------------------------------- /ch8/client/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'app works!'; 10 | } 11 | -------------------------------------------------------------------------------- /ch8/demo1/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'app works!'; 10 | } 11 | -------------------------------------------------------------------------------- /ch2/auction/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = '慕课网Angualr入门实战'; 10 | } 11 | -------------------------------------------------------------------------------- /ch3/auction/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = '慕课网Angular入门实战'; 10 | } 11 | -------------------------------------------------------------------------------- /ch4/auction/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = '慕课网Angular入门实战'; 10 | } 11 | -------------------------------------------------------------------------------- /ch5/auction/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = '慕课网Angular入门实战'; 10 | } 11 | -------------------------------------------------------------------------------- /ch6/auction/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = '慕课网Angular入门实战'; 10 | } 11 | -------------------------------------------------------------------------------- /ch7/auction/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = '慕课网Angular入门实战'; 10 | } 11 | -------------------------------------------------------------------------------- /ch8/auction/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = '慕课网Angular入门实战'; 10 | } 11 | -------------------------------------------------------------------------------- /action/stock/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "es2015", 6 | "baseUrl": "", 7 | "types": [] 8 | }, 9 | "exclude": [ 10 | "test.ts", 11 | "**/*.spec.ts" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /ch8/server/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "emitDecoratorMetadata": true, 6 | "experimentalDecorators": true, 7 | "outDir": "build", 8 | "lib": ["es6"] 9 | }, 10 | "exclude": [ 11 | "node_modules" 12 | ] 13 | } -------------------------------------------------------------------------------- /ch9/server/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "emitDecoratorMetadata": true, 6 | "experimentalDecorators": true, 7 | "outDir": "build", 8 | "lib": ["es6"] 9 | }, 10 | "exclude": [ 11 | "node_modules" 12 | ] 13 | } -------------------------------------------------------------------------------- /action/stock-server/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "emitDecoratorMetadata": true, 6 | "experimentalDecorators": true, 7 | "outDir": "build", 8 | "lib": ["es6"] 9 | }, 10 | "exclude": [ 11 | "node_modules" 12 | ] 13 | } -------------------------------------------------------------------------------- /ch2/stock/src/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /ch8/server/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ch9/server/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /action/stock/src/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /ch4/di/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /ch5/bind/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /ch6/demo2/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |
2 |

我是父组件

3 |
4 | 问候语: 5 |
6 |
7 | 姓名: 8 |
9 | 10 |
11 | -------------------------------------------------------------------------------- /ch7/demo/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /action/stock/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /ch2/auction/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /ch2/start/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /ch2/stock/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /ch2/stock/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "es2015", 6 | "baseUrl": "", 7 | "types": [ 8 | "jquery" 9 | ] 10 | }, 11 | "exclude": [ 12 | "test.ts", 13 | "**/*.spec.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /ch3/auction/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /ch3/router/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /ch4/auction/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /ch5/auction/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /ch5/demo1/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /ch6/auction/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /ch6/demo1/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /ch6/demo2/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /ch6/demo3/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /ch6/demo4/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /ch7/auction/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /ch7/demo1/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /ch8/auction/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /ch8/client/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /ch8/demo1/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /ch9/auction/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /ch9/auction/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "es2015", 6 | "baseUrl": "", 7 | "types": [ 8 | "jquery" 9 | ] 10 | }, 11 | "exclude": [ 12 | "test.ts", 13 | "**/*.spec.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /ch3/auction/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 | 6 |
7 |
8 | 9 |
10 |
11 |
12 | 13 | -------------------------------------------------------------------------------- /ch4/auction/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 | 6 |
7 |
8 | 9 |
10 |
11 |
12 | 13 | -------------------------------------------------------------------------------- /ch5/auction/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 | 6 |
7 |
8 | 9 |
10 |
11 |
12 | 13 | -------------------------------------------------------------------------------- /ch5/bind/src/app/pipe/multiple.pipe.ts: -------------------------------------------------------------------------------- 1 | import { Pipe, PipeTransform } from '@angular/core'; 2 | 3 | @Pipe({ 4 | name: 'multiple' 5 | }) 6 | export class MultiplePipe implements PipeTransform { 7 | 8 | transform(value: number, multiple?: number): number { 9 | 10 | return value * (isNaN(multiple)?1:multiple); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch6/auction/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 | 6 |
7 |
8 | 9 |
10 |
11 |
12 | 13 | -------------------------------------------------------------------------------- /ch7/auction/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 | 6 |
7 |
8 | 9 |
10 |
11 |
12 | 13 | -------------------------------------------------------------------------------- /ch8/auction/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 | 6 |
7 |
8 | 9 |
10 |
11 |
12 | 13 | -------------------------------------------------------------------------------- /ch8/server/build/hello_server.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | /** 4 | * Created by zhailiang on 2017/2/18. 5 | */ 6 | var http = require("http"); 7 | var server = http.createServer(function (request, response) { 8 | response.end("Hello Node!"); 9 | }); 10 | server.listen(8000); 11 | -------------------------------------------------------------------------------- /ch9/auction/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 | 6 |
7 |
8 | 9 |
10 |
11 |
12 | 13 | -------------------------------------------------------------------------------- /ch9/server/build/hello_server.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | /** 4 | * Created by zhailiang on 2017/2/18. 5 | */ 6 | var http = require("http"); 7 | var server = http.createServer(function (request, response) { 8 | response.end("Hello Node!"); 9 | }); 10 | server.listen(8000); 11 | -------------------------------------------------------------------------------- /ch5/demo1/src/app/pipe/multiple.pipe.ts: -------------------------------------------------------------------------------- 1 | import { Pipe, PipeTransform } from '@angular/core'; 2 | 3 | @Pipe({ 4 | name: 'multiple' 5 | }) 6 | export class MultiplePipe implements PipeTransform { 7 | 8 | transform(value: number, args?: number): any { 9 | if(!args) { 10 | args = 1; 11 | } 12 | return value * args; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch9/auction/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import {Component} from "@angular/core"; 2 | import {environment} from "../environments/environment"; 3 | 4 | @Component({ 5 | selector: 'app-root', 6 | templateUrl: './app.component.html', 7 | styleUrls: ['./app.component.css'] 8 | }) 9 | export class AppComponent { 10 | title = '慕课网Angular入门实战'; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /ch3/router/src/app/chat/chat.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-chat', 5 | templateUrl: './chat.component.html', 6 | styleUrls: ['./chat.component.css'] 7 | }) 8 | export class ChatComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch3/router/src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-home', 5 | templateUrl: './home.component.html', 6 | styleUrls: ['./home.component.css'] 7 | }) 8 | export class HomeComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch3/auction/src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-home', 5 | templateUrl: './home.component.html', 6 | styleUrls: ['./home.component.css'] 7 | }) 8 | export class HomeComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch4/auction/src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-home', 5 | templateUrl: './home.component.html', 6 | styleUrls: ['./home.component.css'] 7 | }) 8 | export class HomeComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch4/di/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Di 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch5/auction/src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-home', 5 | templateUrl: './home.component.html', 6 | styleUrls: ['./home.component.css'] 7 | }) 8 | export class HomeComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch6/auction/src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-home', 5 | templateUrl: './home.component.html', 6 | styleUrls: ['./home.component.css'] 7 | }) 8 | export class HomeComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch7/auction/src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-home', 5 | templateUrl: './home.component.html', 6 | styleUrls: ['./home.component.css'] 7 | }) 8 | export class HomeComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch8/auction/src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-home', 5 | templateUrl: './home.component.html', 6 | styleUrls: ['./home.component.css'] 7 | }) 8 | export class HomeComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch9/auction/src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-home', 5 | templateUrl: './home.component.html', 6 | styleUrls: ['./home.component.css'] 7 | }) 8 | export class HomeComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch2/start/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Start 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch5/auction/src/app/pipe/filter.pipe.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { TestBed, async } from '@angular/core/testing'; 4 | import { FilterPipe } from './filter.pipe'; 5 | 6 | describe('FilterPipe', () => { 7 | it('create an instance', () => { 8 | const pipe = new FilterPipe(); 9 | expect(pipe).toBeTruthy(); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /ch5/bind/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Bind 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch5/demo1/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Demo1 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch6/auction/src/app/pipe/filter.pipe.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { TestBed, async } from '@angular/core/testing'; 4 | import { FilterPipe } from './filter.pipe'; 5 | 6 | describe('FilterPipe', () => { 7 | it('create an instance', () => { 8 | const pipe = new FilterPipe(); 9 | expect(pipe).toBeTruthy(); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /ch6/demo1/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Demo1 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch6/demo2/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Demo2 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch6/demo3/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Demo3 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch6/demo4/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Demo4 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch7/auction/src/app/pipe/filter.pipe.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { TestBed, async } from '@angular/core/testing'; 4 | import { FilterPipe } from './filter.pipe'; 5 | 6 | describe('FilterPipe', () => { 7 | it('create an instance', () => { 8 | const pipe = new FilterPipe(); 9 | expect(pipe).toBeTruthy(); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /ch7/demo/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Demo 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch7/demo1/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Demo1 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch8/auction/src/app/pipe/filter.pipe.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { TestBed, async } from '@angular/core/testing'; 4 | import { FilterPipe } from './filter.pipe'; 5 | 6 | describe('FilterPipe', () => { 7 | it('create an instance', () => { 8 | const pipe = new FilterPipe(); 9 | expect(pipe).toBeTruthy(); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /ch8/demo1/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Demo1 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch9/auction/src/app/pipe/filter.pipe.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { TestBed, async } from '@angular/core/testing'; 4 | import { FilterPipe } from './filter.pipe'; 5 | 6 | describe('FilterPipe', () => { 7 | it('create an instance', () => { 8 | const pipe = new FilterPipe(); 9 | expect(pipe).toBeTruthy(); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /action/stock/src/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch2/auction/src/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch2/auction/src/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-navbar', 5 | templateUrl: './navbar.component.html', 6 | styleUrls: ['./navbar.component.css'] 7 | }) 8 | export class NavbarComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch2/auction/src/app/search/search.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-search', 5 | templateUrl: './search.component.html', 6 | styleUrls: ['./search.component.css'] 7 | }) 8 | export class SearchComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch2/auction/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Auction 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch2/stock/src/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch3/auction/src/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch3/auction/src/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-navbar', 5 | templateUrl: './navbar.component.html', 6 | styleUrls: ['./navbar.component.css'] 7 | }) 8 | export class NavbarComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch3/auction/src/app/search/search.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-search', 5 | templateUrl: './search.component.html', 6 | styleUrls: ['./search.component.css'] 7 | }) 8 | export class SearchComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch3/auction/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Auction 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch3/router/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Router 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch4/auction/src/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch4/auction/src/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-navbar', 5 | templateUrl: './navbar.component.html', 6 | styleUrls: ['./navbar.component.css'] 7 | }) 8 | export class NavbarComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch4/auction/src/app/search/search.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-search', 5 | templateUrl: './search.component.html', 6 | styleUrls: ['./search.component.css'] 7 | }) 8 | export class SearchComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch4/auction/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Auction 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch5/auction/src/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch5/auction/src/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-navbar', 5 | templateUrl: './navbar.component.html', 6 | styleUrls: ['./navbar.component.css'] 7 | }) 8 | export class NavbarComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch5/auction/src/app/search/search.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-search', 5 | templateUrl: './search.component.html', 6 | styleUrls: ['./search.component.css'] 7 | }) 8 | export class SearchComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch5/auction/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Auction 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch5/bind/src/app/pipe/multiple.pipe.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { TestBed, async } from '@angular/core/testing'; 4 | import { MultiplePipe } from './multiple.pipe'; 5 | 6 | describe('MultiplePipe', () => { 7 | it('create an instance', () => { 8 | const pipe = new MultiplePipe(); 9 | expect(pipe).toBeTruthy(); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /ch5/demo1/src/app/pipe/multiple.pipe.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { TestBed, async } from '@angular/core/testing'; 4 | import { MultiplePipe } from './multiple.pipe'; 5 | 6 | describe('MultiplePipe', () => { 7 | it('create an instance', () => { 8 | const pipe = new MultiplePipe(); 9 | expect(pipe).toBeTruthy(); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /ch6/auction/src/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch6/auction/src/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-navbar', 5 | templateUrl: './navbar.component.html', 6 | styleUrls: ['./navbar.component.css'] 7 | }) 8 | export class NavbarComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch6/auction/src/app/search/search.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-search', 5 | templateUrl: './search.component.html', 6 | styleUrls: ['./search.component.css'] 7 | }) 8 | export class SearchComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch6/auction/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Auction 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch7/auction/src/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch7/auction/src/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-navbar', 5 | templateUrl: './navbar.component.html', 6 | styleUrls: ['./navbar.component.css'] 7 | }) 8 | export class NavbarComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch7/auction/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Auction 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch8/auction/src/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch8/auction/src/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-navbar', 5 | templateUrl: './navbar.component.html', 6 | styleUrls: ['./navbar.component.css'] 7 | }) 8 | export class NavbarComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch8/auction/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Auction 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch8/client/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Client 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch9/auction/src/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch9/auction/src/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-navbar', 5 | templateUrl: './navbar.component.html', 6 | styleUrls: ['./navbar.component.css'] 7 | }) 8 | export class NavbarComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch9/auction/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Auction4 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /action/stock/src/app/sidebar/sidebar.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-sidebar', 5 | templateUrl: './sidebar.component.html', 6 | styleUrls: ['./sidebar.component.css'] 7 | }) 8 | export class SidebarComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch2/stock/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { StockPage } from './app.po'; 2 | 3 | describe('stock App', () => { 4 | let page: StockPage; 5 | 6 | beforeEach(() => { 7 | page = new StockPage(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /ch2/stock/src/app/sidebar/sidebar.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-sidebar', 5 | templateUrl: './sidebar.component.html', 6 | styleUrls: ['./sidebar.component.css'] 7 | }) 8 | export class SidebarComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch3/router/src/app/code404/code404.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-code404', 5 | templateUrl: './code404.component.html', 6 | styleUrls: ['./code404.component.css'] 7 | }) 8 | export class Code404Component implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /action/stock/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { StockPage } from './app.po'; 2 | 3 | describe('stock App', () => { 4 | let page: StockPage; 5 | 6 | beforeEach(() => { 7 | page = new StockPage(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /ch2/auction/src/app/carousel/carousel.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-carousel', 5 | templateUrl: './carousel.component.html', 6 | styleUrls: ['./carousel.component.css'] 7 | }) 8 | export class CarouselComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch3/auction/src/app/carousel/carousel.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-carousel', 5 | templateUrl: './carousel.component.html', 6 | styleUrls: ['./carousel.component.css'] 7 | }) 8 | export class CarouselComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch4/auction/src/app/carousel/carousel.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-carousel', 5 | templateUrl: './carousel.component.html', 6 | styleUrls: ['./carousel.component.css'] 7 | }) 8 | export class CarouselComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch5/auction/src/app/carousel/carousel.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-carousel', 5 | templateUrl: './carousel.component.html', 6 | styleUrls: ['./carousel.component.css'] 7 | }) 8 | export class CarouselComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch6/auction/src/app/carousel/carousel.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-carousel', 5 | templateUrl: './carousel.component.html', 6 | styleUrls: ['./carousel.component.css'] 7 | }) 8 | export class CarouselComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch6/demo2/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | 10 | greeting:string = "Hello"; 11 | 12 | user:{name:string} = {name: "Tom"}; 13 | 14 | constructor(){ 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ch7/auction/src/app/carousel/carousel.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-carousel', 5 | templateUrl: './carousel.component.html', 6 | styleUrls: ['./carousel.component.css'] 7 | }) 8 | export class CarouselComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch8/auction/src/app/carousel/carousel.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-carousel', 5 | templateUrl: './carousel.component.html', 6 | styleUrls: ['./carousel.component.css'] 7 | }) 8 | export class CarouselComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch9/auction/src/app/carousel/carousel.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-carousel', 5 | templateUrl: './carousel.component.html', 6 | styleUrls: ['./carousel.component.css'] 7 | }) 8 | export class CarouselComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch2/stock/src/app/dashboard/dashboard.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-dashboard', 5 | templateUrl: './dashboard.component.html', 6 | styleUrls: ['./dashboard.component.css'] 7 | }) 8 | export class DashboardComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch3/router/src/app/guard/unsaved.guard.ts: -------------------------------------------------------------------------------- 1 | import {CanDeactivate} from "@angular/router"; 2 | import {ProductComponent} from "../product/product.component"; 3 | /** 4 | * Created by zhailiang on 2017/1/23. 5 | */ 6 | export class UnsavedGuard implements CanDeactivate { 7 | 8 | canDeactivate() { 9 | 10 | return window.confirm("你还没有保存.确定要离开么?"); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch4/di/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Auction4Page } from './app.po'; 2 | 3 | describe('auction4 App', () => { 4 | let page: Auction4Page; 5 | 6 | beforeEach(() => { 7 | page = new Auction4Page(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /ch5/bind/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Auction4Page } from './app.po'; 2 | 3 | describe('auction4 App', () => { 4 | let page: Auction4Page; 5 | 6 | beforeEach(() => { 7 | page = new Auction4Page(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /ch7/demo/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Auction4Page } from './app.po'; 2 | 3 | describe('auction4 App', () => { 4 | let page: Auction4Page; 5 | 6 | beforeEach(() => { 7 | page = new Auction4Page(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /action/stock/src/app/dashboard/dashboard.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-dashboard', 5 | templateUrl: './dashboard.component.html', 6 | styleUrls: ['./dashboard.component.css'] 7 | }) 8 | export class DashboardComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch2/auction/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Auction4Page } from './app.po'; 2 | 3 | describe('auction4 App', () => { 4 | let page: Auction4Page; 5 | 6 | beforeEach(() => { 7 | page = new Auction4Page(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /ch2/start/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Auction4Page } from './app.po'; 2 | 3 | describe('auction4 App', () => { 4 | let page: Auction4Page; 5 | 6 | beforeEach(() => { 7 | page = new Auction4Page(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /ch2/stock/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule); 12 | -------------------------------------------------------------------------------- /ch3/auction/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Auction4Page } from './app.po'; 2 | 3 | describe('auction4 App', () => { 4 | let page: Auction4Page; 5 | 6 | beforeEach(() => { 7 | page = new Auction4Page(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /ch3/router/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Auction4Page } from './app.po'; 2 | 3 | describe('auction4 App', () => { 4 | let page: Auction4Page; 5 | 6 | beforeEach(() => { 7 | page = new Auction4Page(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /ch4/auction/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Auction4Page } from './app.po'; 2 | 3 | describe('auction4 App', () => { 4 | let page: Auction4Page; 5 | 6 | beforeEach(() => { 7 | page = new Auction4Page(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /ch5/auction/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Auction4Page } from './app.po'; 2 | 3 | describe('auction4 App', () => { 4 | let page: Auction4Page; 5 | 6 | beforeEach(() => { 7 | page = new Auction4Page(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /ch5/demo1/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Auction4Page } from './app.po'; 2 | 3 | describe('auction4 App', () => { 4 | let page: Auction4Page; 5 | 6 | beforeEach(() => { 7 | page = new Auction4Page(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /ch6/auction/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Auction4Page } from './app.po'; 2 | 3 | describe('auction4 App', () => { 4 | let page: Auction4Page; 5 | 6 | beforeEach(() => { 7 | page = new Auction4Page(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /ch6/demo1/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Auction4Page } from './app.po'; 2 | 3 | describe('auction4 App', () => { 4 | let page: Auction4Page; 5 | 6 | beforeEach(() => { 7 | page = new Auction4Page(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /ch6/demo1/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /ch6/demo2/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Auction4Page } from './app.po'; 2 | 3 | describe('auction4 App', () => { 4 | let page: Auction4Page; 5 | 6 | beforeEach(() => { 7 | page = new Auction4Page(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /ch6/demo3/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Auction4Page } from './app.po'; 2 | 3 | describe('auction4 App', () => { 4 | let page: Auction4Page; 5 | 6 | beforeEach(() => { 7 | page = new Auction4Page(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /ch6/demo4/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Auction4Page } from './app.po'; 2 | 3 | describe('auction4 App', () => { 4 | let page: Auction4Page; 5 | 6 | beforeEach(() => { 7 | page = new Auction4Page(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /ch7/auction/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Auction4Page } from './app.po'; 2 | 3 | describe('auction4 App', () => { 4 | let page: Auction4Page; 5 | 6 | beforeEach(() => { 7 | page = new Auction4Page(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /ch7/demo1/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Auction4Page } from './app.po'; 2 | 3 | describe('auction4 App', () => { 4 | let page: Auction4Page; 5 | 6 | beforeEach(() => { 7 | page = new Auction4Page(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /ch8/auction/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Auction4Page } from './app.po'; 2 | 3 | describe('auction4 App', () => { 4 | let page: Auction4Page; 5 | 6 | beforeEach(() => { 7 | page = new Auction4Page(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /ch8/client/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Auction4Page } from './app.po'; 2 | 3 | describe('auction4 App', () => { 4 | let page: Auction4Page; 5 | 6 | beforeEach(() => { 7 | page = new Auction4Page(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /ch8/demo1/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Auction4Page } from './app.po'; 2 | 3 | describe('auction4 App', () => { 4 | let page: Auction4Page; 5 | 6 | beforeEach(() => { 7 | page = new Auction4Page(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /ch9/auction/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { Auction4Page } from './app.po'; 2 | 3 | describe('auction4 App', () => { 4 | let page: Auction4Page; 5 | 6 | beforeEach(() => { 7 | page = new Auction4Page(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /action/stock/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule); 12 | -------------------------------------------------------------------------------- /ch9/auction/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule); 12 | -------------------------------------------------------------------------------- /ch3/router/src/app/product/product-desc/product-desc.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-product-desc', 5 | templateUrl: './product-desc.component.html', 6 | styleUrls: ['./product-desc.component.css'] 7 | }) 8 | export class ProductDescComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /action/stock/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Stock 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /action/stock/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "baseUrl": "", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | }, 13 | "files": [ 14 | "test.ts" 15 | ], 16 | "include": [ 17 | "**/*.spec.ts", 18 | "**/*.d.ts" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /ch2/stock/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Stock 6 | 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch2/stock/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "baseUrl": "", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | }, 13 | "files": [ 14 | "test.ts" 15 | ], 16 | "include": [ 17 | "**/*.spec.ts", 18 | "**/*.d.ts" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /ch9/auction/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "baseUrl": "", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | }, 13 | "files": [ 14 | "test.ts" 15 | ], 16 | "include": [ 17 | "**/*.spec.ts", 18 | "**/*.d.ts" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /ch2/start/src/main.ts: -------------------------------------------------------------------------------- 1 | import './polyfills.ts'; 2 | 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | import { enableProdMode } from '@angular/core'; 5 | import { environment } from './environments/environment'; 6 | import { AppModule } from './app/app.module'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule); 13 | -------------------------------------------------------------------------------- /ch4/di/src/main.ts: -------------------------------------------------------------------------------- 1 | import './polyfills.ts'; 2 | 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | import { enableProdMode } from '@angular/core'; 5 | import { environment } from './environments/environment'; 6 | import { AppModule } from './app/app.module'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule); 13 | -------------------------------------------------------------------------------- /ch5/bind/src/main.ts: -------------------------------------------------------------------------------- 1 | import './polyfills.ts'; 2 | 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | import { enableProdMode } from '@angular/core'; 5 | import { environment } from './environments/environment'; 6 | import { AppModule } from './app/app.module'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule); 13 | -------------------------------------------------------------------------------- /ch5/demo1/src/main.ts: -------------------------------------------------------------------------------- 1 | import './polyfills.ts'; 2 | 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | import { enableProdMode } from '@angular/core'; 5 | import { environment } from './environments/environment'; 6 | import { AppModule } from './app/app.module'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule); 13 | -------------------------------------------------------------------------------- /ch6/demo1/src/main.ts: -------------------------------------------------------------------------------- 1 | import './polyfills.ts'; 2 | 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | import { enableProdMode } from '@angular/core'; 5 | import { environment } from './environments/environment'; 6 | import { AppModule } from './app/app.module'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule); 13 | -------------------------------------------------------------------------------- /ch6/demo2/src/main.ts: -------------------------------------------------------------------------------- 1 | import './polyfills.ts'; 2 | 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | import { enableProdMode } from '@angular/core'; 5 | import { environment } from './environments/environment'; 6 | import { AppModule } from './app/app.module'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule); 13 | -------------------------------------------------------------------------------- /ch6/demo3/src/main.ts: -------------------------------------------------------------------------------- 1 | import './polyfills.ts'; 2 | 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | import { enableProdMode } from '@angular/core'; 5 | import { environment } from './environments/environment'; 6 | import { AppModule } from './app/app.module'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule); 13 | -------------------------------------------------------------------------------- /ch6/demo4/src/main.ts: -------------------------------------------------------------------------------- 1 | import './polyfills.ts'; 2 | 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | import { enableProdMode } from '@angular/core'; 5 | import { environment } from './environments/environment'; 6 | import { AppModule } from './app/app.module'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule); 13 | -------------------------------------------------------------------------------- /ch7/demo/src/main.ts: -------------------------------------------------------------------------------- 1 | import './polyfills.ts'; 2 | 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | import { enableProdMode } from '@angular/core'; 5 | import { environment } from './environments/environment'; 6 | import { AppModule } from './app/app.module'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule); 13 | -------------------------------------------------------------------------------- /ch7/demo1/src/main.ts: -------------------------------------------------------------------------------- 1 | import './polyfills.ts'; 2 | 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | import { enableProdMode } from '@angular/core'; 5 | import { environment } from './environments/environment'; 6 | import { AppModule } from './app/app.module'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule); 13 | -------------------------------------------------------------------------------- /ch8/demo1/src/main.ts: -------------------------------------------------------------------------------- 1 | import './polyfills.ts'; 2 | 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | import { enableProdMode } from '@angular/core'; 5 | import { environment } from './environments/environment'; 6 | import { AppModule } from './app/app.module'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule); 13 | -------------------------------------------------------------------------------- /ch2/auction/src/main.ts: -------------------------------------------------------------------------------- 1 | import './polyfills.ts'; 2 | 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | import { enableProdMode } from '@angular/core'; 5 | import { environment } from './environments/environment'; 6 | import { AppModule } from './app/app.module'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule); 13 | -------------------------------------------------------------------------------- /ch3/auction/src/main.ts: -------------------------------------------------------------------------------- 1 | import './polyfills.ts'; 2 | 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | import { enableProdMode } from '@angular/core'; 5 | import { environment } from './environments/environment'; 6 | import { AppModule } from './app/app.module'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule); 13 | -------------------------------------------------------------------------------- /ch3/router/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | Home 2 | Product Details 3 | 4 | Open Chat 5 | Close Chat 6 | 7 | 8 | -------------------------------------------------------------------------------- /ch3/router/src/main.ts: -------------------------------------------------------------------------------- 1 | import './polyfills.ts'; 2 | 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | import { enableProdMode } from '@angular/core'; 5 | import { environment } from './environments/environment'; 6 | import { AppModule } from './app/app.module'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule); 13 | -------------------------------------------------------------------------------- /ch4/auction/src/main.ts: -------------------------------------------------------------------------------- 1 | import './polyfills.ts'; 2 | 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | import { enableProdMode } from '@angular/core'; 5 | import { environment } from './environments/environment'; 6 | import { AppModule } from './app/app.module'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule); 13 | -------------------------------------------------------------------------------- /ch5/auction/src/main.ts: -------------------------------------------------------------------------------- 1 | import './polyfills.ts'; 2 | 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | import { enableProdMode } from '@angular/core'; 5 | import { environment } from './environments/environment'; 6 | import { AppModule } from './app/app.module'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule); 13 | -------------------------------------------------------------------------------- /ch6/auction/src/main.ts: -------------------------------------------------------------------------------- 1 | import './polyfills.ts'; 2 | 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | import { enableProdMode } from '@angular/core'; 5 | import { environment } from './environments/environment'; 6 | import { AppModule } from './app/app.module'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule); 13 | -------------------------------------------------------------------------------- /ch7/auction/src/main.ts: -------------------------------------------------------------------------------- 1 | import './polyfills.ts'; 2 | 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | import { enableProdMode } from '@angular/core'; 5 | import { environment } from './environments/environment'; 6 | import { AppModule } from './app/app.module'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule); 13 | -------------------------------------------------------------------------------- /ch7/demo/src/app/directives/equal-validator.directive.ts: -------------------------------------------------------------------------------- 1 | import { Directive } from '@angular/core'; 2 | import {NG_VALIDATORS} from "@angular/forms"; 3 | import {equalValidator} from "../validator/validators"; 4 | 5 | @Directive({ 6 | selector: '[equal]', 7 | providers: [{provide: NG_VALIDATORS, useValue:equalValidator, multi:true}] 8 | }) 9 | export class EqualValidatorDirective { 10 | 11 | constructor() { } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch8/auction/src/main.ts: -------------------------------------------------------------------------------- 1 | import './polyfills.ts'; 2 | 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | import { enableProdMode } from '@angular/core'; 5 | import { environment } from './environments/environment'; 6 | import { AppModule } from './app/app.module'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule); 13 | -------------------------------------------------------------------------------- /ch8/client/src/main.ts: -------------------------------------------------------------------------------- 1 | import './polyfills.ts'; 2 | 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | import { enableProdMode } from '@angular/core'; 5 | import { environment } from './environments/environment'; 6 | import { AppModule } from './app/app.module'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule); 13 | -------------------------------------------------------------------------------- /ch7/demo/src/app/directives/mobile-validator.directive.ts: -------------------------------------------------------------------------------- 1 | import {Directive} from "@angular/core"; 2 | import {NG_VALIDATORS} from "@angular/forms"; 3 | import {mobileValidator} from "../validator/validators"; 4 | 5 | @Directive({ 6 | selector: '[mobile]', 7 | providers: [{provide: NG_VALIDATORS, useValue:mobileValidator, multi:true}] 8 | }) 9 | export class MobileValidatorDirective { 10 | 11 | constructor() { } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch4/di/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /ch5/bind/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /ch7/demo/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /ch2/auction/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /ch2/start/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /ch3/auction/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /ch3/router/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /ch4/auction/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /ch5/auction/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /ch5/demo1/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /ch6/auction/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /ch6/demo1/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /ch6/demo2/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /ch6/demo3/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /ch6/demo4/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /ch7/auction/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /ch7/demo1/src/app/directives/mobile-validator.directive.ts: -------------------------------------------------------------------------------- 1 | import {Directive} from "@angular/core"; 2 | import {NG_VALIDATORS} from "@angular/forms"; 3 | import {mobileValidator} from "../validator/validators"; 4 | 5 | @Directive({ 6 | selector: '[mobile]', 7 | providers: [{provide: NG_VALIDATORS, useValue: mobileValidator, multi: true}] 8 | }) 9 | export class MobileValidatorDirective { 10 | 11 | constructor() { 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /ch7/demo1/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /ch8/auction/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /ch8/client/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /ch8/demo1/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /ch9/auction/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /ch5/demo1/src/app/child1/child1.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, OnInit} from "@angular/core"; 2 | 3 | @Component({ 4 | selector: 'app-child1', 5 | templateUrl: './child1.component.html', 6 | styleUrls: ['./child1.component.css'] 7 | }) 8 | export class Child1Component implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | greet(name:string) { 16 | console.log("Hello "+name); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /ch7/demo/src/app/directives/equal-validator.directive.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { TestBed, async } from '@angular/core/testing'; 4 | import { EqualValidatorDirective } from './equal-validator.directive'; 5 | 6 | describe('EqualValidatorDirective', () => { 7 | it('should create an instance', () => { 8 | const directive = new EqualValidatorDirective(); 9 | expect(directive).toBeTruthy(); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /ch7/demo/src/app/directives/mobile-validator.directive.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { TestBed, async } from '@angular/core/testing'; 4 | import { MobileValidatorDirective } from './mobile-validator.directive'; 5 | 6 | describe('MobileValidatorDirective', () => { 7 | it('should create an instance', () => { 8 | const directive = new MobileValidatorDirective(); 9 | expect(directive).toBeTruthy(); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /ch7/demo1/src/app/directives/mobile-validator.directive.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { TestBed, async } from '@angular/core/testing'; 4 | import { MobileValidatorDirective } from './mobile-validator.directive'; 5 | 6 | describe('MobileValidatorDirective', () => { 7 | it('should create an instance', () => { 8 | const directive = new MobileValidatorDirective(); 9 | expect(directive).toBeTruthy(); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /ch8/demo1/src/app/shared/observable.service.ts: -------------------------------------------------------------------------------- 1 | import {Injectable} from "@angular/core"; 2 | import {Observable} from "rxjs"; 3 | 4 | @Injectable() 5 | export class ObservableService { 6 | 7 | constructor() { } 8 | 9 | createObservable(): Observable { 10 | return new Observable( 11 | observer => { 12 | setInterval(() => 13 | observer.next(new Date()) 14 | , 1000); 15 | } 16 | ); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ch2/stock/src/app/stock/stock.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, inject } from '@angular/core/testing'; 2 | 3 | import { StockService } from './stock.service'; 4 | 5 | describe('StockService', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [StockService] 9 | }); 10 | }); 11 | 12 | it('should ...', inject([StockService], (service: StockService) => { 13 | expect(service).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /ch5/demo1/src/app/bind/bind.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, OnInit} from "@angular/core"; 2 | 3 | @Component({ 4 | selector: 'app-bind', 5 | templateUrl: './bind.component.html', 6 | styleUrls: ['./bind.component.css'] 7 | }) 8 | export class BindComponent implements OnInit { 9 | 10 | birthday:Date = new Date(); 11 | 12 | pi:number = 3; 13 | 14 | size:number = 7; 15 | 16 | constructor() { 17 | } 18 | 19 | ngOnInit() { 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /action/stock/src/app/stock/stock.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, inject } from '@angular/core/testing'; 2 | 3 | import { StockService } from './stock.service'; 4 | 5 | describe('StockService', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [StockService] 9 | }); 10 | }); 11 | 12 | it('should ...', inject([StockService], (service: StockService) => { 13 | expect(service).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /ch4/di/src/app/shared/another-product.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import {ProductService, Product} from "./product.service"; 3 | import {LoggerService} from "./logger.service"; 4 | 5 | @Injectable() 6 | export class AnotherProductService implements ProductService{ 7 | 8 | getProduct(): Product { 9 | return new Product(1, "sumsung7", 4899, "最新款三星手机") 10 | } 11 | 12 | constructor(public logger:LoggerService) { } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /ch7/demo1/src/app/directives/password-validator.directive.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | 3 | import { TestBed, async } from '@angular/core/testing'; 4 | import { PasswordValidatorDirective } from './password-validator.directive'; 5 | 6 | describe('PasswordValidatorDirective', () => { 7 | it('should create an instance', () => { 8 | const directive = new PasswordValidatorDirective(); 9 | expect(directive).toBeTruthy(); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /ch2/stock/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false, 8 | appTitle:'开发环境' 9 | }; 10 | -------------------------------------------------------------------------------- /ch5/demo1/src/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, OnInit, OnDestroy} from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent implements OnInit, OnDestroy { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | ngOnDestroy(): void { 16 | console.log("我是页脚,我被销毁了。"); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /ch6/demo4/src/app/child2/child2.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, OnInit, OnDestroy} from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-child2', 5 | templateUrl: './child2.component.html', 6 | styleUrls: ['./child2.component.css'] 7 | }) 8 | export class Child2Component implements OnInit, OnDestroy { 9 | 10 | ngOnDestroy(): void { 11 | console.log("child2组件被销毁"); 12 | } 13 | 14 | constructor() { } 15 | 16 | ngOnInit() { 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /ch8/demo1/src/app/product/product.component.html: -------------------------------------------------------------------------------- 1 |
2 | 商品信息 3 |
4 | 9 | 10 |
11 | 12 | 13 | 14 |
15 | 16 |

{{productTitle}}:{{productPrice}}

17 | -------------------------------------------------------------------------------- /action/stock/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false, 8 | appTitle:'开发环境' 9 | }; 10 | -------------------------------------------------------------------------------- /ch4/di/src/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "", 4 | "declaration": false, 5 | "emitDecoratorMetadata": true, 6 | "experimentalDecorators": true, 7 | "lib": ["es6", "dom"], 8 | "mapRoot": "./", 9 | "module": "es6", 10 | "moduleResolution": "node", 11 | "outDir": "../dist/out-tsc", 12 | "sourceMap": true, 13 | "target": "es5", 14 | "typeRoots": [ 15 | "../node_modules/@types" 16 | ] 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ch5/bind/src/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "", 4 | "declaration": false, 5 | "emitDecoratorMetadata": true, 6 | "experimentalDecorators": true, 7 | "lib": ["es6", "dom"], 8 | "mapRoot": "./", 9 | "module": "es6", 10 | "moduleResolution": "node", 11 | "outDir": "../dist/out-tsc", 12 | "sourceMap": true, 13 | "target": "es5", 14 | "typeRoots": [ 15 | "../node_modules/@types" 16 | ] 17 | } 18 | } 19 | --------------------------------------------------------------------------------