├── .gitignore ├── LICENSE ├── README.md ├── chapter_1 ├── 1.hello-world │ ├── app │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── main.ts │ ├── index.html │ ├── package.json │ ├── styles.css │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 2.hello-input │ ├── app │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── main.ts │ ├── index.html │ ├── package.json │ ├── styles.css │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 3.hello-bootstrap │ ├── app │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── main.ts │ ├── index.html │ ├── package.json │ ├── styles.css │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json └── README.md ├── chapter_10 ├── ecommerce-firebase-auth │ ├── .bootstraprc │ ├── .eslintrc.yml │ ├── .firebaserc │ ├── database.rules.json │ ├── firebase.import.json │ ├── firebase.json │ ├── package.json │ ├── src │ │ ├── app │ │ │ ├── app.component.html │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ ├── app.routes.ts │ │ │ ├── auth │ │ │ │ ├── auth.guard.ts │ │ │ │ ├── auth.module.ts │ │ │ │ ├── auth.scss │ │ │ │ ├── auth.service.ts │ │ │ │ ├── sign-in.component.html │ │ │ │ └── sign-in.component.ts │ │ │ ├── cart │ │ │ │ ├── cart-item-count.component.html │ │ │ │ ├── cart-item-count.component.ts │ │ │ │ ├── cart-menu.component.html │ │ │ │ ├── cart-menu.component.ts │ │ │ │ ├── cart-view.component.html │ │ │ │ ├── cart-view.component.ts │ │ │ │ ├── cart.module.ts │ │ │ │ └── cart.service.ts │ │ │ ├── category │ │ │ │ ├── category-card.component.html │ │ │ │ ├── category-card.component.ts │ │ │ │ ├── category-list.component.html │ │ │ │ ├── category-list.component.ts │ │ │ │ ├── category-slide.component.html │ │ │ │ ├── category-slide.component.ts │ │ │ │ ├── category.module.ts │ │ │ │ ├── category.pipe.ts │ │ │ │ └── category.service.ts │ │ │ ├── checkout │ │ │ │ ├── checkout-view.component.html │ │ │ │ └── checkout-view.component.ts │ │ │ ├── footer │ │ │ │ ├── footer.component.html │ │ │ │ └── footer.component.ts │ │ │ ├── navbar │ │ │ │ ├── navbar.component.html │ │ │ │ └── navbar.component.ts │ │ │ ├── product │ │ │ │ ├── product-card.component.html │ │ │ │ ├── product-card.component.ts │ │ │ │ ├── product-grid.component.html │ │ │ │ ├── product-grid.component.ts │ │ │ │ ├── product-list.component.html │ │ │ │ ├── product-list.component.ts │ │ │ │ ├── product-search.component.html │ │ │ │ ├── product-search.component.ts │ │ │ │ ├── product-view.component.html │ │ │ │ ├── product-view.component.ts │ │ │ │ ├── product.module.ts │ │ │ │ └── product.service.ts │ │ │ ├── shared │ │ │ │ ├── if.directive.ts │ │ │ │ └── zip.validator.ts │ │ │ └── welcome │ │ │ │ ├── welcome.component.html │ │ │ │ └── welcome.component.ts │ │ ├── assets │ │ │ └── ecommerce.scss │ │ ├── index.html │ │ ├── main.ts │ │ ├── polyfills.ts │ │ └── vendor.ts │ ├── tsconfig.json │ ├── typings.json │ └── webpack.config.js ├── ecommerce-ng2-bootstrap │ ├── .bootstraprc │ ├── .eslintrc.yml │ ├── .firebaserc │ ├── database.rules.json │ ├── firebase.import.json │ ├── firebase.json │ ├── package.json │ ├── src │ │ ├── app │ │ │ ├── app.component.html │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ ├── app.routes.ts │ │ │ ├── auth │ │ │ │ ├── auth.guard.ts │ │ │ │ ├── auth.module.ts │ │ │ │ ├── auth.scss │ │ │ │ ├── auth.service.ts │ │ │ │ ├── sign-in.component.html │ │ │ │ └── sign-in.component.ts │ │ │ ├── cart │ │ │ │ ├── cart-item-count.component.html │ │ │ │ ├── cart-item-count.component.ts │ │ │ │ ├── cart-menu.component.html │ │ │ │ ├── cart-menu.component.ts │ │ │ │ ├── cart-view.component.html │ │ │ │ ├── cart-view.component.ts │ │ │ │ ├── cart.module.ts │ │ │ │ └── cart.service.ts │ │ │ ├── category │ │ │ │ ├── category-card.component.html │ │ │ │ ├── category-card.component.ts │ │ │ │ ├── category-list.component.html │ │ │ │ ├── category-list.component.ts │ │ │ │ ├── category-slide.component.html │ │ │ │ ├── category-slide.component.ts │ │ │ │ ├── category.module.ts │ │ │ │ ├── category.pipe.ts │ │ │ │ └── category.service.ts │ │ │ ├── checkout │ │ │ │ ├── checkout-view.component.html │ │ │ │ └── checkout-view.component.ts │ │ │ ├── footer │ │ │ │ ├── footer.component.html │ │ │ │ └── footer.component.ts │ │ │ ├── navbar │ │ │ │ ├── navbar.component.html │ │ │ │ └── navbar.component.ts │ │ │ ├── product │ │ │ │ ├── product-card.component.html │ │ │ │ ├── product-card.component.ts │ │ │ │ ├── product-grid.component.html │ │ │ │ ├── product-grid.component.ts │ │ │ │ ├── product-list.component.html │ │ │ │ ├── product-list.component.ts │ │ │ │ ├── product-search.component.html │ │ │ │ ├── product-search.component.ts │ │ │ │ ├── product-view.component.html │ │ │ │ ├── product-view.component.ts │ │ │ │ ├── product.module.ts │ │ │ │ └── product.service.ts │ │ │ ├── shared │ │ │ │ ├── if.directive.ts │ │ │ │ └── zip.validator.ts │ │ │ └── welcome │ │ │ │ ├── welcome.component.html │ │ │ │ └── welcome.component.ts │ │ ├── assets │ │ │ └── ecommerce.scss │ │ ├── index.html │ │ ├── main.ts │ │ ├── polyfills.ts │ │ └── vendor.ts │ ├── tsconfig.json │ ├── typings.json │ └── webpack.config.js ├── ecommerce-webpack-advanced │ ├── .bootstraprc │ ├── .eslintrc.yml │ ├── .firebaserc │ ├── database.rules.json │ ├── firebase.import.json │ ├── firebase.json │ ├── package.json │ ├── src │ │ ├── app │ │ │ ├── app.component.html │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ ├── app.routes.ts │ │ │ ├── cart │ │ │ │ ├── cart-item-count.component.html │ │ │ │ ├── cart-item-count.component.ts │ │ │ │ ├── cart-menu.component.html │ │ │ │ ├── cart-menu.component.ts │ │ │ │ ├── cart-view.component.html │ │ │ │ ├── cart-view.component.ts │ │ │ │ ├── cart.module.ts │ │ │ │ └── cart.service.ts │ │ │ ├── category │ │ │ │ ├── category-card.component.html │ │ │ │ ├── category-card.component.ts │ │ │ │ ├── category-list.component.html │ │ │ │ ├── category-list.component.ts │ │ │ │ ├── category-slide.component.html │ │ │ │ ├── category-slide.component.ts │ │ │ │ ├── category.module.ts │ │ │ │ ├── category.pipe.ts │ │ │ │ └── category.service.ts │ │ │ ├── checkout │ │ │ │ ├── checkout-view.component.html │ │ │ │ └── checkout-view.component.ts │ │ │ ├── footer │ │ │ │ ├── footer.component.html │ │ │ │ └── footer.component.ts │ │ │ ├── navbar │ │ │ │ ├── navbar.component.html │ │ │ │ └── navbar.component.ts │ │ │ ├── product │ │ │ │ ├── product-card.component.html │ │ │ │ ├── product-card.component.ts │ │ │ │ ├── product-grid.component.html │ │ │ │ ├── product-grid.component.ts │ │ │ │ ├── product-list.component.html │ │ │ │ ├── product-list.component.ts │ │ │ │ ├── product-search.component.html │ │ │ │ ├── product-search.component.ts │ │ │ │ ├── product-view.component.html │ │ │ │ ├── product-view.component.ts │ │ │ │ ├── product.module.ts │ │ │ │ └── product.service.ts │ │ │ ├── shared │ │ │ │ ├── if.directive.ts │ │ │ │ └── zip.validator.ts │ │ │ └── welcome │ │ │ │ ├── welcome.component.html │ │ │ │ └── welcome.component.ts │ │ ├── assets │ │ │ └── ecommerce.scss │ │ ├── index.html │ │ ├── main.ts │ │ ├── polyfills.ts │ │ └── vendor.ts │ ├── tsconfig.json │ ├── typings.json │ └── webpack.config.js └── ecommerce-webpack │ ├── .firebaserc │ ├── app │ ├── app.component.html │ ├── app.component.ts │ ├── app.module.ts │ ├── app.routes.ts │ ├── cart │ │ ├── cart-item-count.component.html │ │ ├── cart-item-count.component.ts │ │ ├── cart-menu.component.html │ │ ├── cart-menu.component.ts │ │ ├── cart-view.component.html │ │ ├── cart-view.component.ts │ │ ├── cart.module.ts │ │ └── cart.service.ts │ ├── category │ │ ├── category-card.component.html │ │ ├── category-card.component.ts │ │ ├── category-list.component.html │ │ ├── category-list.component.ts │ │ ├── category-slide.component.html │ │ ├── category-slide.component.ts │ │ ├── category.module.ts │ │ ├── category.pipe.ts │ │ └── category.service.ts │ ├── checkout │ │ ├── checkout-view.component.html │ │ └── checkout-view.component.ts │ ├── footer │ │ ├── footer.component.html │ │ └── footer.component.ts │ ├── main.ts │ ├── navbar │ │ ├── navbar.component.html │ │ └── navbar.component.ts │ ├── product │ │ ├── product-card.component.html │ │ ├── product-card.component.ts │ │ ├── product-grid.component.html │ │ ├── product-grid.component.ts │ │ ├── product-list.component.html │ │ ├── product-list.component.ts │ │ ├── product-search.component.html │ │ ├── product-search.component.ts │ │ ├── product-view.component.html │ │ ├── product-view.component.ts │ │ ├── product.module.ts │ │ └── product.service.ts │ ├── shared │ │ ├── if.directive.ts │ │ └── zip.validator.ts │ └── welcome │ │ ├── welcome.component.html │ │ └── welcome.component.ts │ ├── assets │ └── ecommerce.css │ ├── database.rules.json │ ├── firebase.import.json │ ├── firebase.json │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ ├── typings.json │ └── webpack.config.js ├── chapter_2 ├── 1.ecommerce-seed │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── main.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 2.ecommerce-grid │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── main.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 3.ecommerce-cards │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── main.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 4.ecommerce-responsive │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── main.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json └── README.md ├── chapter_3 ├── 1.ecommerce-seed │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── main.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 2.ecommerce-jumbotron │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── main.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 3.ecommerce-carousel │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── main.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 4.ecommerce-input-group │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── main.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 5.ecommerce-list-group │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── main.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 6.ecommerce-grid-in-grid │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── main.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 7.ecommerce-dropdown │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── main.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json └── README.md ├── chapter_4 ├── 1.ecommerce-seed │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── main.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 2.ecommerce-navbar │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── main.ts │ │ ├── navbar │ │ │ ├── navbar.component.html │ │ │ └── navbar.component.ts │ │ └── shared │ │ │ └── if.directive.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 3.ecommerce-category │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── category │ │ │ ├── category-card.component.html │ │ │ ├── category-card.component.ts │ │ │ ├── category-slide.component.html │ │ │ ├── category-slide.component.ts │ │ │ ├── category.module.ts │ │ │ └── category.ts │ │ ├── main.ts │ │ ├── navbar │ │ │ ├── navbar.component.html │ │ │ └── navbar.component.ts │ │ └── shared │ │ │ └── if.directive.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json └── README.md ├── chapter_5 ├── 1.ecommerce-seed │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── category │ │ │ ├── category-card.component.html │ │ │ ├── category-card.component.ts │ │ │ ├── category-slide.component.html │ │ │ ├── category-slide.component.ts │ │ │ ├── category.module.ts │ │ │ └── category.ts │ │ ├── main.ts │ │ ├── navbar │ │ │ ├── navbar.component.html │ │ │ └── navbar.component.ts │ │ └── shared │ │ │ └── if.directive.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 2.ecommerce-router │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── app.routes.ts │ │ ├── category │ │ │ ├── category-card.component.html │ │ │ ├── category-card.component.ts │ │ │ ├── category-list.component.html │ │ │ ├── category-list.component.ts │ │ │ ├── category-slide.component.html │ │ │ ├── category-slide.component.ts │ │ │ ├── category.module.ts │ │ │ └── category.ts │ │ ├── footer │ │ │ ├── footer.component.html │ │ │ └── footer.component.ts │ │ ├── main.ts │ │ ├── navbar │ │ │ ├── navbar.component.html │ │ │ └── navbar.component.ts │ │ ├── product │ │ │ ├── product-card.component.html │ │ │ ├── product-card.component.ts │ │ │ ├── product-grid.component.html │ │ │ ├── product-grid.component.ts │ │ │ ├── product-list.component.html │ │ │ ├── product-list.component.ts │ │ │ ├── product-search.component.html │ │ │ ├── product-search.component.ts │ │ │ ├── product.module.ts │ │ │ └── product.ts │ │ ├── shared │ │ │ └── if.directive.ts │ │ └── welcome │ │ │ ├── welcome.component.html │ │ │ └── welcome.component.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 3.ecommerce-router-search │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── app.routes.ts │ │ ├── category │ │ │ ├── category-card.component.html │ │ │ ├── category-card.component.ts │ │ │ ├── category-list.component.html │ │ │ ├── category-list.component.ts │ │ │ ├── category-slide.component.html │ │ │ ├── category-slide.component.ts │ │ │ ├── category.module.ts │ │ │ └── category.ts │ │ ├── footer │ │ │ ├── footer.component.html │ │ │ └── footer.component.ts │ │ ├── main.ts │ │ ├── navbar │ │ │ ├── navbar.component.html │ │ │ └── navbar.component.ts │ │ ├── product │ │ │ ├── product-card.component.html │ │ │ ├── product-card.component.ts │ │ │ ├── product-grid.component.html │ │ │ ├── product-grid.component.ts │ │ │ ├── product-list.component.html │ │ │ ├── product-list.component.ts │ │ │ ├── product-search.component.html │ │ │ ├── product-search.component.ts │ │ │ ├── product.module.ts │ │ │ └── product.ts │ │ ├── shared │ │ │ └── if.directive.ts │ │ └── welcome │ │ │ ├── welcome.component.html │ │ │ └── welcome.component.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json └── README.md ├── chapter_6 ├── 1.ecommerce-seed │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── app.routes.ts │ │ ├── category │ │ │ ├── category-card.component.html │ │ │ ├── category-card.component.ts │ │ │ ├── category-list.component.html │ │ │ ├── category-list.component.ts │ │ │ ├── category-slide.component.html │ │ │ ├── category-slide.component.ts │ │ │ ├── category.module.ts │ │ │ └── category.ts │ │ ├── footer │ │ │ ├── footer.component.html │ │ │ └── footer.component.ts │ │ ├── main.ts │ │ ├── navbar │ │ │ ├── navbar.component.html │ │ │ └── navbar.component.ts │ │ ├── product │ │ │ ├── product-card.component.html │ │ │ ├── product-card.component.ts │ │ │ ├── product-grid.component.html │ │ │ ├── product-grid.component.ts │ │ │ ├── product-list.component.html │ │ │ ├── product-list.component.ts │ │ │ ├── product-search.component.html │ │ │ ├── product-search.component.ts │ │ │ ├── product.module.ts │ │ │ └── product.ts │ │ ├── shared │ │ │ └── if.directive.ts │ │ └── welcome │ │ │ ├── welcome.component.html │ │ │ └── welcome.component.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 2.ecommerce-di │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── app.routes.ts │ │ ├── category │ │ │ ├── category-card.component.html │ │ │ ├── category-card.component.ts │ │ │ ├── category-list.component.html │ │ │ ├── category-list.component.ts │ │ │ ├── category-slide.component.html │ │ │ ├── category-slide.component.ts │ │ │ ├── category.module.ts │ │ │ ├── category.service.ts │ │ │ └── index.ts │ │ ├── footer │ │ │ ├── footer.component.html │ │ │ └── footer.component.ts │ │ ├── main.ts │ │ ├── navbar │ │ │ ├── navbar.component.html │ │ │ └── navbar.component.ts │ │ ├── product │ │ │ ├── product-card.component.html │ │ │ ├── product-card.component.ts │ │ │ ├── product-grid.component.html │ │ │ ├── product-grid.component.ts │ │ │ ├── product-list.component.html │ │ │ ├── product-list.component.ts │ │ │ ├── product-search.component.html │ │ │ ├── product-search.component.ts │ │ │ ├── product.module.ts │ │ │ └── product.service.ts │ │ ├── shared │ │ │ └── if.directive.ts │ │ └── welcome │ │ │ ├── welcome.component.html │ │ │ └── welcome.component.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 3.ecommerce-cart │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── app.routes.ts │ │ ├── cart │ │ │ ├── cart-menu.component.html │ │ │ ├── cart-menu.component.ts │ │ │ ├── cart.module.ts │ │ │ └── cart.service.ts │ │ ├── category │ │ │ ├── category-card.component.html │ │ │ ├── category-card.component.ts │ │ │ ├── category-list.component.html │ │ │ ├── category-list.component.ts │ │ │ ├── category-slide.component.html │ │ │ ├── category-slide.component.ts │ │ │ ├── category.module.ts │ │ │ ├── category.service.ts │ │ │ └── index.ts │ │ ├── footer │ │ │ ├── footer.component.html │ │ │ └── footer.component.ts │ │ ├── main.ts │ │ ├── navbar │ │ │ ├── navbar.component.html │ │ │ └── navbar.component.ts │ │ ├── product │ │ │ ├── index.ts │ │ │ ├── product-card.component.html │ │ │ ├── product-card.component.ts │ │ │ ├── product-grid.component.html │ │ │ ├── product-grid.component.ts │ │ │ ├── product-list.component.html │ │ │ ├── product-list.component.ts │ │ │ ├── product-search.component.html │ │ │ ├── product-search.component.ts │ │ │ ├── product.module.ts │ │ │ └── product.service.ts │ │ ├── shared │ │ │ └── if.directive.ts │ │ └── welcome │ │ │ ├── welcome.component.html │ │ │ └── welcome.component.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json └── README.md ├── chapter_7 ├── 1.ecommerce-seed │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── app.routes.ts │ │ ├── cart │ │ │ ├── cart-menu.component.html │ │ │ ├── cart-menu.component.ts │ │ │ ├── cart.module.ts │ │ │ └── cart.service.ts │ │ ├── category │ │ │ ├── category-card.component.html │ │ │ ├── category-card.component.ts │ │ │ ├── category-list.component.html │ │ │ ├── category-list.component.ts │ │ │ ├── category-slide.component.html │ │ │ ├── category-slide.component.ts │ │ │ ├── category.module.ts │ │ │ ├── category.service.ts │ │ │ └── index.ts │ │ ├── footer │ │ │ ├── footer.component.html │ │ │ └── footer.component.ts │ │ ├── main.ts │ │ ├── navbar │ │ │ ├── navbar.component.html │ │ │ └── navbar.component.ts │ │ ├── product │ │ │ ├── index.ts │ │ │ ├── product-card.component.html │ │ │ ├── product-card.component.ts │ │ │ ├── product-grid.component.html │ │ │ ├── product-grid.component.ts │ │ │ ├── product-list.component.html │ │ │ ├── product-list.component.ts │ │ │ ├── product-search.component.html │ │ │ ├── product-search.component.ts │ │ │ ├── product.module.ts │ │ │ └── product.service.ts │ │ ├── shared │ │ │ └── if.directive.ts │ │ └── welcome │ │ │ ├── welcome.component.html │ │ │ └── welcome.component.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 2.ecommerce-key-event-listenning │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── app.routes.ts │ │ ├── cart │ │ │ ├── cart-menu.component.html │ │ │ ├── cart-menu.component.ts │ │ │ ├── cart.module.ts │ │ │ └── cart.service.ts │ │ ├── category │ │ │ ├── category-card.component.html │ │ │ ├── category-card.component.ts │ │ │ ├── category-list.component.html │ │ │ ├── category-list.component.ts │ │ │ ├── category-slide.component.html │ │ │ ├── category-slide.component.ts │ │ │ ├── category.module.ts │ │ │ └── category.service.ts │ │ ├── footer │ │ │ ├── footer.component.html │ │ │ └── footer.component.ts │ │ ├── main.ts │ │ ├── navbar │ │ │ ├── navbar.component.html │ │ │ └── navbar.component.ts │ │ ├── product │ │ │ ├── product-card.component.html │ │ │ ├── product-card.component.ts │ │ │ ├── product-grid.component.html │ │ │ ├── product-grid.component.ts │ │ │ ├── product-list.component.html │ │ │ ├── product-list.component.ts │ │ │ ├── product-search.component.html │ │ │ ├── product-search.component.ts │ │ │ ├── product.module.ts │ │ │ └── product.service.ts │ │ ├── shared │ │ │ └── if.directive.ts │ │ └── welcome │ │ │ ├── welcome.component.html │ │ │ └── welcome.component.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 3.ecommerce-product-view │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── app.routes.ts │ │ ├── cart │ │ │ ├── cart-menu.component.html │ │ │ ├── cart-menu.component.ts │ │ │ ├── cart.module.ts │ │ │ └── cart.service.ts │ │ ├── category │ │ │ ├── category-card.component.html │ │ │ ├── category-card.component.ts │ │ │ ├── category-list.component.html │ │ │ ├── category-list.component.ts │ │ │ ├── category-slide.component.html │ │ │ ├── category-slide.component.ts │ │ │ ├── category.module.ts │ │ │ ├── category.pipe.ts │ │ │ └── category.service.ts │ │ ├── footer │ │ │ ├── footer.component.html │ │ │ └── footer.component.ts │ │ ├── main.ts │ │ ├── navbar │ │ │ ├── navbar.component.html │ │ │ └── navbar.component.ts │ │ ├── product │ │ │ ├── product-card.component.html │ │ │ ├── product-card.component.ts │ │ │ ├── product-grid.component.html │ │ │ ├── product-grid.component.ts │ │ │ ├── product-list.component.html │ │ │ ├── product-list.component.ts │ │ │ ├── product-search.component.html │ │ │ ├── product-search.component.ts │ │ │ ├── product-view.component.html │ │ │ ├── product-view.component.ts │ │ │ ├── product.module.ts │ │ │ └── product.service.ts │ │ ├── shared │ │ │ └── if.directive.ts │ │ └── welcome │ │ │ ├── welcome.component.html │ │ │ └── welcome.component.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 4.ecommerce-cart-view │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── app.routes.ts │ │ ├── cart │ │ │ ├── cart-menu.component.html │ │ │ ├── cart-menu.component.ts │ │ │ ├── cart-view.component.html │ │ │ ├── cart-view.component.ts │ │ │ ├── cart.module.ts │ │ │ └── cart.service.ts │ │ ├── category │ │ │ ├── category-card.component.html │ │ │ ├── category-card.component.ts │ │ │ ├── category-list.component.html │ │ │ ├── category-list.component.ts │ │ │ ├── category-slide.component.html │ │ │ ├── category-slide.component.ts │ │ │ ├── category.module.ts │ │ │ ├── category.pipe.ts │ │ │ └── category.service.ts │ │ ├── footer │ │ │ ├── footer.component.html │ │ │ └── footer.component.ts │ │ ├── main.ts │ │ ├── navbar │ │ │ ├── navbar.component.html │ │ │ └── navbar.component.ts │ │ ├── product │ │ │ ├── product-card.component.html │ │ │ ├── product-card.component.ts │ │ │ ├── product-grid.component.html │ │ │ ├── product-grid.component.ts │ │ │ ├── product-list.component.html │ │ │ ├── product-list.component.ts │ │ │ ├── product-search.component.html │ │ │ ├── product-search.component.ts │ │ │ ├── product-view.component.html │ │ │ ├── product-view.component.ts │ │ │ ├── product.module.ts │ │ │ └── product.service.ts │ │ ├── shared │ │ │ ├── if.directive.ts │ │ │ └── zip.validator.ts │ │ └── welcome │ │ │ ├── welcome.component.html │ │ │ └── welcome.component.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 5.ecommerce-checkout-view │ ├── app │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── app.routes.ts │ │ ├── cart │ │ │ ├── cart-menu.component.html │ │ │ ├── cart-menu.component.ts │ │ │ ├── cart-view.component.html │ │ │ ├── cart-view.component.ts │ │ │ ├── cart.module.ts │ │ │ └── cart.service.ts │ │ ├── category │ │ │ ├── category-card.component.html │ │ │ ├── category-card.component.ts │ │ │ ├── category-list.component.html │ │ │ ├── category-list.component.ts │ │ │ ├── category-slide.component.html │ │ │ ├── category-slide.component.ts │ │ │ ├── category.module.ts │ │ │ ├── category.pipe.ts │ │ │ └── category.service.ts │ │ ├── checkout │ │ │ ├── checkout-view.component.html │ │ │ └── checkout-view.component.ts │ │ ├── footer │ │ │ ├── footer.component.html │ │ │ └── footer.component.ts │ │ ├── main.ts │ │ ├── navbar │ │ │ ├── navbar.component.html │ │ │ └── navbar.component.ts │ │ ├── product │ │ │ ├── product-card.component.html │ │ │ ├── product-card.component.ts │ │ │ ├── product-grid.component.html │ │ │ ├── product-grid.component.ts │ │ │ ├── product-list.component.html │ │ │ ├── product-list.component.ts │ │ │ ├── product-search.component.html │ │ │ ├── product-search.component.ts │ │ │ ├── product-view.component.html │ │ │ ├── product-view.component.ts │ │ │ ├── product.module.ts │ │ │ └── product.service.ts │ │ ├── shared │ │ │ ├── if.directive.ts │ │ │ └── zip.validator.ts │ │ └── welcome │ │ │ ├── welcome.component.html │ │ │ └── welcome.component.ts │ ├── assets │ │ └── ecommerce.css │ ├── index.html │ ├── package.json │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json └── README.md ├── chapter_8 ├── 1.view-encapsulation │ ├── app │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── child.component.ts │ │ ├── main.ts │ │ └── parent.component.ts │ ├── index.html │ ├── package.json │ ├── styles.css │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 2.after-content │ ├── app │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── child.component.ts │ │ ├── main.ts │ │ └── parent.component.ts │ ├── index.html │ ├── package.json │ ├── styles.css │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 3.after-view │ ├── app │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── child.component.ts │ │ ├── main.ts │ │ └── parent.component.ts │ ├── index.html │ ├── package.json │ ├── styles.css │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 4.parent-child-input-binding │ ├── app │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── child.component.ts │ │ ├── main.ts │ │ └── parent.component.ts │ ├── index.html │ ├── package.json │ ├── styles.css │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 5.parent-child-local-variable │ ├── app │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── child.component.ts │ │ ├── main.ts │ │ ├── ng-init.directive.ts │ │ └── parent.component.ts │ ├── index.html │ ├── package.json │ ├── styles.css │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 6.parent-child-viewchild │ ├── app │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── child.component.ts │ │ ├── main.ts │ │ └── parent.component.ts │ ├── index.html │ ├── package.json │ ├── styles.css │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json ├── 7.parent-child-service │ ├── app │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── child.component.ts │ │ ├── common.service.ts │ │ ├── main.ts │ │ └── parent.component.ts │ ├── index.html │ ├── package.json │ ├── styles.css │ ├── systemjs.config.js │ ├── tsconfig.json │ └── typings.json └── README.md └── chapter_9 ├── ecommerce-firebase ├── .firebaserc ├── app │ ├── app.component.html │ ├── app.component.ts │ ├── app.module.ts │ ├── app.routes.ts │ ├── cart │ │ ├── cart-item-count.component.html │ │ ├── cart-item-count.component.ts │ │ ├── cart-menu.component.html │ │ ├── cart-menu.component.ts │ │ ├── cart-view.component.html │ │ ├── cart-view.component.ts │ │ ├── cart.module.ts │ │ └── cart.service.ts │ ├── category │ │ ├── category-card.component.html │ │ ├── category-card.component.ts │ │ ├── category-list.component.html │ │ ├── category-list.component.ts │ │ ├── category-slide.component.html │ │ ├── category-slide.component.ts │ │ ├── category.module.ts │ │ ├── category.pipe.ts │ │ └── category.service.ts │ ├── checkout │ │ ├── checkout-view.component.html │ │ └── checkout-view.component.ts │ ├── footer │ │ ├── footer.component.html │ │ └── footer.component.ts │ ├── main.ts │ ├── navbar │ │ ├── navbar.component.html │ │ └── navbar.component.ts │ ├── product │ │ ├── product-card.component.html │ │ ├── product-card.component.ts │ │ ├── product-grid.component.html │ │ ├── product-grid.component.ts │ │ ├── product-list.component.html │ │ ├── product-list.component.ts │ │ ├── product-search.component.html │ │ ├── product-search.component.ts │ │ ├── product-view.component.html │ │ ├── product-view.component.ts │ │ ├── product.module.ts │ │ └── product.service.ts │ ├── shared │ │ ├── if.directive.ts │ │ └── zip.validator.ts │ └── welcome │ │ ├── welcome.component.html │ │ └── welcome.component.ts ├── assets │ └── ecommerce.css ├── database.rules.json ├── firebase.import.json ├── firebase.json ├── index.html ├── package.json ├── systemjs.config.js ├── tsconfig.json └── typings.json ├── ecommerce-observable ├── app │ ├── app.component.html │ ├── app.component.ts │ ├── app.module.ts │ ├── app.routes.ts │ ├── cart │ │ ├── cart-item-count.component.html │ │ ├── cart-item-count.component.ts │ │ ├── cart-menu.component.html │ │ ├── cart-menu.component.ts │ │ ├── cart-view.component.html │ │ ├── cart-view.component.ts │ │ ├── cart.module.ts │ │ └── cart.service.ts │ ├── category │ │ ├── category-card.component.html │ │ ├── category-card.component.ts │ │ ├── category-list.component.html │ │ ├── category-list.component.ts │ │ ├── category-slide.component.html │ │ ├── category-slide.component.ts │ │ ├── category.module.ts │ │ ├── category.pipe.ts │ │ └── category.service.ts │ ├── checkout │ │ ├── checkout-view.component.html │ │ └── checkout-view.component.ts │ ├── footer │ │ ├── footer.component.html │ │ └── footer.component.ts │ ├── in-memory-data.service.ts │ ├── main.ts │ ├── navbar │ │ ├── navbar.component.html │ │ └── navbar.component.ts │ ├── product │ │ ├── product-card.component.html │ │ ├── product-card.component.ts │ │ ├── product-grid.component.html │ │ ├── product-grid.component.ts │ │ ├── product-list.component.html │ │ ├── product-list.component.ts │ │ ├── product-search.component.html │ │ ├── product-search.component.ts │ │ ├── product-view.component.html │ │ ├── product-view.component.ts │ │ ├── product.module.ts │ │ └── product.service.ts │ ├── shared │ │ ├── if.directive.ts │ │ └── zip.validator.ts │ └── welcome │ │ ├── welcome.component.html │ │ └── welcome.component.ts ├── assets │ └── ecommerce.css ├── index.html ├── package.json ├── systemjs.config.js ├── tsconfig.json └── typings.json └── ecommerce-promise ├── app ├── app.component.html ├── app.component.ts ├── app.module.ts ├── app.routes.ts ├── cart │ ├── cart-item-count.component.html │ ├── cart-item-count.component.ts │ ├── cart-menu.component.html │ ├── cart-menu.component.ts │ ├── cart-view.component.html │ ├── cart-view.component.ts │ ├── cart.module.ts │ └── cart.service.ts ├── category │ ├── category-card.component.html │ ├── category-card.component.ts │ ├── category-list.component.html │ ├── category-list.component.ts │ ├── category-slide.component.html │ ├── category-slide.component.ts │ ├── category.module.ts │ ├── category.pipe.ts │ └── category.service.ts ├── checkout │ ├── checkout-view.component.html │ └── checkout-view.component.ts ├── footer │ ├── footer.component.html │ └── footer.component.ts ├── in-memory-data.service.ts ├── main.ts ├── navbar │ ├── navbar.component.html │ └── navbar.component.ts ├── product │ ├── product-card.component.html │ ├── product-card.component.ts │ ├── product-grid.component.html │ ├── product-grid.component.ts │ ├── product-list.component.html │ ├── product-list.component.ts │ ├── product-search.component.html │ ├── product-search.component.ts │ ├── product-view.component.html │ ├── product-view.component.ts │ ├── product.module.ts │ └── product.service.ts ├── shared │ ├── if.directive.ts │ └── zip.validator.ts └── welcome │ ├── welcome.component.html │ └── welcome.component.ts ├── assets └── ecommerce.css ├── index.html ├── package.json ├── systemjs.config.js ├── tsconfig.json └── typings.json /chapter_1/1.hello-world/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'my-app', 5 | template: '

Hello, World

'}) 6 | export class AppComponent {} 7 | 8 | -------------------------------------------------------------------------------- /chapter_1/1.hello-world/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | 4 | import { AppComponent } from './app.component'; 5 | 6 | @NgModule({ 7 | imports: [ BrowserModule ], 8 | declarations: [ AppComponent ], 9 | bootstrap: [ AppComponent ] 10 | 11 | }) 12 | export class AppModule { } 13 | -------------------------------------------------------------------------------- /chapter_1/1.hello-world/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app.module'; 4 | 5 | const platform = platformBrowserDynamic(); 6 | 7 | platform.bootstrapModule(AppModule); 8 | -------------------------------------------------------------------------------- /chapter_1/1.hello-world/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 2em; 3 | } -------------------------------------------------------------------------------- /chapter_1/1.hello-world/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_1/1.hello-world/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_1/2.hello-input/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'my-app', 5 | template: ` 6 |

Hello, {{name || 'World'}}

7 | 8 | `}) 9 | export class AppComponent { 10 | name: string = 'World'; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /chapter_1/2.hello-input/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { FormsModule } from '@angular/forms'; 4 | 5 | import { AppComponent } from './app.component'; 6 | 7 | @NgModule({ 8 | imports: [ BrowserModule, FormsModule ], 9 | declarations: [ AppComponent ], 10 | bootstrap: [ AppComponent ] 11 | 12 | }) 13 | export class AppModule { } 14 | -------------------------------------------------------------------------------- /chapter_1/2.hello-input/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app.module'; 4 | 5 | const platform = platformBrowserDynamic(); 6 | 7 | platform.bootstrapModule(AppModule); 8 | -------------------------------------------------------------------------------- /chapter_1/2.hello-input/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 2em; 3 | } -------------------------------------------------------------------------------- /chapter_1/2.hello-input/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_1/2.hello-input/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_1/3.hello-bootstrap/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'my-app', 5 | template: ` 6 |
7 | 10 |
11 |

Hello, {{name || 'World'}}

12 | 13 |
14 |
15 | `}) 16 | export class AppComponent { 17 | name: string = 'World'; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter_1/3.hello-bootstrap/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { FormsModule } from '@angular/forms'; 4 | 5 | import { AppComponent } from './app.component'; 6 | 7 | @NgModule({ 8 | imports: [ BrowserModule, FormsModule ], 9 | declarations: [ AppComponent ], 10 | bootstrap: [ AppComponent ] 11 | 12 | }) 13 | export class AppModule { } 14 | -------------------------------------------------------------------------------- /chapter_1/3.hello-bootstrap/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app.module'; 4 | 5 | const platform = platformBrowserDynamic(); 6 | 7 | platform.bootstrapModule(AppModule); 8 | -------------------------------------------------------------------------------- /chapter_1/3.hello-bootstrap/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 2em; 3 | } -------------------------------------------------------------------------------- /chapter_1/3.hello-bootstrap/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_1/3.hello-bootstrap/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-firebase-auth/.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "ecommerce-a99fc" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-firebase-auth/database.rules.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | ".read": "auth != null", 4 | ".write": "auth != null", 5 | "products": { 6 | ".indexOn": ["categoryId", "title"] 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /chapter_10/ecommerce-firebase-auth/firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "database": { 3 | "rules": "database.rules.json" 4 | }, 5 | "hosting": { 6 | "public": "./dist", 7 | "rewrites": [ 8 | { 9 | "source": "**", 10 | "destination": "/index.html" 11 | } 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-firebase-auth/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-firebase-auth/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from "@angular/core"; 5 | 6 | @Component({ 7 | selector: "my-app", 8 | template: require("./app.component.html") 9 | }) 10 | export class AppComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-firebase-auth/src/app/cart/cart-item-count.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-firebase-auth/src/app/cart/cart-menu.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input} from "@angular/core"; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Cart, CartService} from "./cart.service"; 10 | 11 | @Component({ 12 | selector: "db-cart-menu", 13 | template: require("./cart-menu.component.html") 14 | }) 15 | export class CartMenuComponent { 16 | 17 | private cart: Cart; 18 | 19 | constructor(private cartService: CartService) { 20 | this.cart = this.cartService.cart; 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-firebase-auth/src/app/category/category-card.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{category.title}} 4 |
5 |

{{category.title}}

6 |

{{category.desc}}

7 | 8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-firebase-auth/src/app/category/category-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Categories
3 |
4 | {{category.title}} 6 |
7 |
-------------------------------------------------------------------------------- /chapter_10/ecommerce-firebase-auth/src/app/category/category-slide.component.html: -------------------------------------------------------------------------------- 1 | {{category.title}} 2 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-firebase-auth/src/app/category/category-slide.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input, Output, EventEmitter} from "@angular/core"; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Category} from "./category.service"; 10 | 11 | @Component({ 12 | selector: "db-category-slide", 13 | template: require("./category-slide.component.html") 14 | }) 15 | export class CategorySlideComponent { 16 | @Input() category: Category; 17 | @Output() select: EventEmitter = new EventEmitter(); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-firebase-auth/src/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Contact Info
5 | 0000 Market St, Suite 000, San Francisco, CA 00000, (123) 456-7890, support@dream-bean.com 6 |
7 |
8 |
-------------------------------------------------------------------------------- /chapter_10/ecommerce-firebase-auth/src/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Components 3 | */ 4 | import {Component} from "@angular/core"; 5 | 6 | @Component({ 7 | selector: "db-footer", 8 | template: require("./footer.component.html") 9 | }) 10 | export class FooterComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-firebase-auth/src/app/product/product-grid.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-firebase-auth/src/app/product/product-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 |
10 |
11 |
-------------------------------------------------------------------------------- /chapter_10/ecommerce-firebase-auth/src/app/product/product-list.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from "@angular/core"; 5 | 6 | @Component({ 7 | selector: "db-products", 8 | template: require("./product-list.component.html") 9 | }) 10 | export class ProductListComponent {} 11 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-firebase-auth/src/app/product/product-search.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Quick Shop
3 | 5 |
-------------------------------------------------------------------------------- /chapter_10/ecommerce-firebase-auth/src/app/product/product-search.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from "@angular/core"; 5 | import {Router} from "@angular/router"; 6 | 7 | @Component({ 8 | selector: "db-product-search", 9 | template: require("./product-search.component.html") 10 | }) 11 | export class ProductSearchComponent { 12 | 13 | constructor(private router: Router) {} 14 | 15 | searchProduct(value: string) { 16 | this.router.navigate(["/products"], { queryParams: { search: value} }); 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-firebase-auth/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | The Dream Bean Grocery Store 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Loading... 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-firebase-auth/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | // Core-JS 2 | import "core-js/es6/array"; 3 | import "core-js/es6/map"; 4 | import "core-js/es6/set"; 5 | import "core-js/es6/string"; 6 | import "core-js/es6/symbol"; 7 | import "core-js/es7/reflect"; 8 | import "core-js/fn/object/assign"; 9 | 10 | // Zone 11 | import "zone.js/dist/zone"; 12 | 13 | // Typescript helpers 14 | import "ts-helpers"; 15 | 16 | 17 | if (process.env.NODE_ENV === "development") { 18 | Error.stackTraceLimit = Infinity; 19 | require("zone.js/dist/long-stack-trace-zone"); 20 | } 21 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-firebase-auth/src/vendor.ts: -------------------------------------------------------------------------------- 1 | // Angular 2 | import "@angular/common"; 3 | import "@angular/core"; 4 | import "@angular/forms"; 5 | import "@angular/platform-browser-dynamic"; 6 | import "@angular/router"; 7 | 8 | // RxJS 9 | import "rxjs/add/observable/merge"; 10 | import "rxjs/add/operator/do"; 11 | import "rxjs/add/operator/map"; 12 | import "rxjs/add/operator/pluck"; 13 | import "rxjs/add/operator/switchMap"; 14 | import "rxjs/add/operator/take"; 15 | 16 | // Bootstrap 4 17 | import "jquery"; 18 | import "bootstrap-loader"; 19 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-firebase-auth/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "emitDecoratorMetadata": true, 5 | "experimentalDecorators": true, 6 | "lib": [ 7 | "dom", 8 | "es5" 9 | ], 10 | "module": "commonjs", 11 | "noEmitHelpers": true, 12 | "removeComments": true, 13 | "sourceMap": true, 14 | "target": "es5", 15 | "types": [ 16 | "core-js", 17 | "firebase", 18 | "node" 19 | ] 20 | }, 21 | "exclude": [ 22 | "node_modules", 23 | "dist" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-firebase-auth/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160602141332", 4 | "node": "registry:dt/node#6.0.0+20160807145350" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-ng2-bootstrap/.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "ecommerce-a99fc" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-ng2-bootstrap/database.rules.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | ".read": "auth != null", 4 | ".write": "auth != null", 5 | "products": { 6 | ".indexOn": ["categoryId", "title"] 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /chapter_10/ecommerce-ng2-bootstrap/firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "database": { 3 | "rules": "database.rules.json" 4 | }, 5 | "hosting": { 6 | "public": "./dist", 7 | "rewrites": [ 8 | { 9 | "source": "**", 10 | "destination": "/index.html" 11 | } 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-ng2-bootstrap/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-ng2-bootstrap/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from "@angular/core"; 5 | 6 | @Component({ 7 | selector: "my-app", 8 | template: require("./app.component.html") 9 | }) 10 | export class AppComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-ng2-bootstrap/src/app/cart/cart-item-count.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-ng2-bootstrap/src/app/cart/cart-menu.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import { Component, Input } from "@angular/core"; 5 | 6 | /* 7 | * Components 8 | */ 9 | import { Cart, CartService } from "./cart.service"; 10 | 11 | @Component({ 12 | selector: "db-cart-menu", 13 | template: require("./cart-menu.component.html") 14 | }) 15 | export class CartMenuComponent { 16 | 17 | private cart: Cart; 18 | 19 | constructor(private cartService: CartService) { 20 | this.cart = this.cartService.cart; 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-ng2-bootstrap/src/app/category/category-card.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{category.title}} 4 |
5 |

{{category.title}}

6 |

{{category.desc}}

7 | 8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-ng2-bootstrap/src/app/category/category-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Categories
3 | 7 |
-------------------------------------------------------------------------------- /chapter_10/ecommerce-ng2-bootstrap/src/app/category/category-slide.component.html: -------------------------------------------------------------------------------- 1 | {{category.title}} 2 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-ng2-bootstrap/src/app/category/category-slide.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input, Output, EventEmitter} from "@angular/core"; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Category} from "./category.service"; 10 | 11 | @Component({ 12 | selector: "db-category-slide", 13 | template: require("./category-slide.component.html") 14 | }) 15 | export class CategorySlideComponent { 16 | @Input() category: Category; 17 | @Output() select: EventEmitter = new EventEmitter(); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-ng2-bootstrap/src/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Contact Info
5 | 0000 Market St, Suite 000, San Francisco, CA 00000, (123) 456-7890, support@dream-bean.com 6 |
7 |
8 |
-------------------------------------------------------------------------------- /chapter_10/ecommerce-ng2-bootstrap/src/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Components 3 | */ 4 | import {Component} from "@angular/core"; 5 | 6 | @Component({ 7 | selector: "db-footer", 8 | template: require("./footer.component.html") 9 | }) 10 | export class FooterComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-ng2-bootstrap/src/app/product/product-grid.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-ng2-bootstrap/src/app/product/product-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 |
10 |
11 |
-------------------------------------------------------------------------------- /chapter_10/ecommerce-ng2-bootstrap/src/app/product/product-list.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from "@angular/core"; 5 | 6 | @Component({ 7 | selector: "db-products", 8 | template: require("./product-list.component.html") 9 | }) 10 | export class ProductListComponent {} 11 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-ng2-bootstrap/src/app/product/product-search.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Quick Shop
3 | 5 |
-------------------------------------------------------------------------------- /chapter_10/ecommerce-ng2-bootstrap/src/app/product/product-search.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from "@angular/core"; 5 | import {Router} from "@angular/router"; 6 | 7 | @Component({ 8 | selector: "db-product-search", 9 | template: require("./product-search.component.html") 10 | }) 11 | export class ProductSearchComponent { 12 | 13 | constructor(private router: Router) {} 14 | 15 | searchProduct(value: string) { 16 | this.router.navigate(["/products"], { queryParams: { search: value} }); 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-ng2-bootstrap/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | // Core-JS 2 | import "core-js/es6/array"; 3 | import "core-js/es6/map"; 4 | import "core-js/es6/set"; 5 | import "core-js/es6/string"; 6 | import "core-js/es6/symbol"; 7 | import "core-js/es7/reflect"; 8 | import "core-js/fn/object/assign"; 9 | 10 | // Zone 11 | import "zone.js/dist/zone"; 12 | 13 | // Typescript helpers 14 | import "ts-helpers"; 15 | 16 | 17 | if (process.env.NODE_ENV === "development") { 18 | Error.stackTraceLimit = Infinity; 19 | require("zone.js/dist/long-stack-trace-zone"); 20 | } 21 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-ng2-bootstrap/src/vendor.ts: -------------------------------------------------------------------------------- 1 | // Angular 2 | import "@angular/common"; 3 | import "@angular/core"; 4 | import "@angular/forms"; 5 | import "@angular/platform-browser-dynamic"; 6 | import "@angular/router"; 7 | 8 | // RxJS 9 | import "rxjs/add/observable/merge"; 10 | import "rxjs/add/operator/do"; 11 | import "rxjs/add/operator/map"; 12 | import "rxjs/add/operator/pluck"; 13 | import "rxjs/add/operator/switchMap"; 14 | import "rxjs/add/operator/take"; 15 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-ng2-bootstrap/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160602141332", 4 | "node": "registry:dt/node#6.0.0+20160807145350" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack-advanced/.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "ecommerce-a99fc" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack-advanced/database.rules.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | ".read": true, 4 | ".write": "auth != null", 5 | "products": { 6 | ".indexOn": ["categoryId", "title"] 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack-advanced/firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "database": { 3 | "rules": "database.rules.json" 4 | }, 5 | "hosting": { 6 | "public": "./dist", 7 | "rewrites": [ 8 | { 9 | "source": "**", 10 | "destination": "/index.html" 11 | } 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack-advanced/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack-advanced/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from "@angular/core"; 5 | 6 | @Component({ 7 | selector: "my-app", 8 | template: require("./app.component.html") 9 | }) 10 | export class AppComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack-advanced/src/app/cart/cart-item-count.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack-advanced/src/app/cart/cart-menu.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input} from "@angular/core"; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Cart, CartService} from "./cart.service"; 10 | 11 | @Component({ 12 | selector: "db-cart-menu", 13 | template: require("./cart-menu.component.html") 14 | }) 15 | export class CartMenuComponent { 16 | 17 | private cart: Cart; 18 | 19 | constructor(private cartService: CartService) { 20 | this.cart = this.cartService.cart; 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack-advanced/src/app/category/category-card.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{category.title}} 4 |
5 |

{{category.title}}

6 |

{{category.desc}}

7 | 8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack-advanced/src/app/category/category-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Categories
3 | 7 |
-------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack-advanced/src/app/category/category-slide.component.html: -------------------------------------------------------------------------------- 1 | {{category.title}} 2 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack-advanced/src/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Contact Info
5 | 0000 Market St, Suite 000, San Francisco, CA 00000, (123) 456-7890, support@dream-bean.com 6 |
7 |
8 |
-------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack-advanced/src/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Components 3 | */ 4 | import {Component} from "@angular/core"; 5 | 6 | @Component({ 7 | selector: "db-footer", 8 | template: require("./footer.component.html") 9 | }) 10 | export class FooterComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack-advanced/src/app/navbar/navbar.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack-advanced/src/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import { Component } from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-navbar', 8 | templateUrl: 'app/navbar/navbar.component.html' 9 | }) 10 | export class NavbarComponent { } 11 | 12 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack-advanced/src/app/product/product-grid.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack-advanced/src/app/product/product-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 |
10 |
11 |
-------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack-advanced/src/app/product/product-list.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from "@angular/core"; 5 | 6 | @Component({ 7 | selector: "db-products", 8 | template: require("./product-list.component.html") 9 | }) 10 | export class ProductListComponent {} 11 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack-advanced/src/app/product/product-search.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Quick Shop
3 | 5 |
-------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack-advanced/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | The Dream Bean Grocery Store 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Loading... 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack-advanced/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | // Core-JS 2 | import "core-js/es6/array"; 3 | import "core-js/es6/map"; 4 | import "core-js/es6/set"; 5 | import "core-js/es6/string"; 6 | import "core-js/es6/symbol"; 7 | import "core-js/es7/reflect"; 8 | import "core-js/fn/object/assign"; 9 | 10 | // Zone 11 | import "zone.js/dist/zone"; 12 | 13 | // Typescript helpers 14 | import "ts-helpers"; 15 | 16 | 17 | if (process.env.NODE_ENV === "development") { 18 | Error.stackTraceLimit = Infinity; 19 | require("zone.js/dist/long-stack-trace-zone"); 20 | } 21 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack-advanced/src/vendor.ts: -------------------------------------------------------------------------------- 1 | // Angular 2 | import "@angular/common"; 3 | import "@angular/core"; 4 | import "@angular/forms"; 5 | import "@angular/platform-browser-dynamic"; 6 | import "@angular/router"; 7 | 8 | // RxJS 9 | import "rxjs/add/observable/merge"; 10 | import "rxjs/add/operator/do"; 11 | import "rxjs/add/operator/map"; 12 | import "rxjs/add/operator/pluck"; 13 | import "rxjs/add/operator/switchMap"; 14 | import "rxjs/add/operator/take"; 15 | 16 | // Bootstrap 4 17 | import "jquery"; 18 | import "bootstrap-loader"; 19 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack-advanced/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "emitDecoratorMetadata": true, 5 | "experimentalDecorators": true, 6 | "lib": [ 7 | "dom", 8 | "es5" 9 | ], 10 | "module": "commonjs", 11 | "noEmitHelpers": true, 12 | "removeComments": true, 13 | "sourceMap": true, 14 | "target": "es5", 15 | "types": [ 16 | "core-js", 17 | "firebase", 18 | "node" 19 | ] 20 | }, 21 | "exclude": [ 22 | "node_modules", 23 | "dist" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack-advanced/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160602141332", 4 | "node": "registry:dt/node#6.0.0+20160807145350" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack/.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "ecommerce-a99fc" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'my-app', 8 | templateUrl: 'app/app.component.html', 9 | }) 10 | export class AppComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack/app/cart/cart-item-count.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack/app/cart/cart-menu.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Cart, CartService} from './cart.service'; 10 | 11 | @Component({ 12 | selector: 'db-cart-menu', 13 | templateUrl: 'app/cart/cart-menu.component.html' 14 | }) 15 | export class CartMenuComponent { 16 | 17 | private cart: Cart; 18 | 19 | constructor(private cartService: CartService) { 20 | this.cart = this.cartService.cart; 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack/app/category/category-card.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{category.title}} 4 |
5 |

{{category.title}}

6 |

{{category.desc}}

7 | 8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack/app/category/category-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Categories
3 | 7 |
-------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack/app/category/category-slide.component.html: -------------------------------------------------------------------------------- 1 | {{category.title}} 2 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack/app/category/category-slide.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input, Output, EventEmitter} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Category} from './category.service'; 10 | 11 | @Component({ 12 | selector: 'db-category-slide', 13 | templateUrl: 'app/category/category-slide.component.html' 14 | }) 15 | export class CategorySlideComponent { 16 | @Input() category: Category; 17 | @Output() select: EventEmitter = new EventEmitter(); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Contact Info
5 | 0000 Market St, Suite 000, San Francisco, CA 00000, (123) 456-7890, support@dream-bean.com 6 |
7 |
8 |
-------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Components 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-footer', 8 | templateUrl: 'app/footer/footer.component.html' 9 | }) 10 | export class FooterComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack/app/main.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; 5 | 6 | /* 7 | * The app module 8 | */ 9 | import {AppModule} from './app.module'; 10 | 11 | /* 12 | * Bootstrap out application 13 | */ 14 | platformBrowserDynamic().bootstrapModule(AppModule); 15 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack/app/navbar/navbar.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import { Component } from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-navbar', 8 | templateUrl: 'app/navbar/navbar.component.html' 9 | }) 10 | export class NavbarComponent { } 11 | 12 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack/app/product/product-grid.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack/app/product/product-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 |
10 |
11 |
-------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack/app/product/product-list.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-products', 8 | templateUrl: 'app/product/product-list.component.html' 9 | }) 10 | export class ProductListComponent {} 11 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack/app/product/product-search.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Quick Shop
3 | 5 |
-------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack/app/product/product-search.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | import {Router} from '@angular/router'; 6 | 7 | @Component({ 8 | selector: 'db-product-search', 9 | templateUrl: 'app/product/product-search.component.html' 10 | }) 11 | export class ProductSearchComponent { 12 | 13 | constructor(private router: Router) {} 14 | 15 | searchProduct(value: string) { 16 | this.router.navigate(['/products'], { queryParams: { search: value} }); 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack/database.rules.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | ".read": true, 4 | ".write": "auth != null", 5 | "products": { 6 | ".indexOn": ["categoryId", "title"] 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack/firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "database": { 3 | "rules": "database.rules.json" 4 | }, 5 | "hosting": { 6 | "public": ".", 7 | "rewrites": [ 8 | { 9 | "source": "**", 10 | "destination": "/index.html" 11 | } 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } -------------------------------------------------------------------------------- /chapter_10/ecommerce-webpack/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160602141332", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160807145350" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_2/1.ecommerce-seed/app/app.component.html: -------------------------------------------------------------------------------- 1 | Hello World -------------------------------------------------------------------------------- /chapter_2/1.ecommerce-seed/app/app.component.ts: -------------------------------------------------------------------------------- 1 | // Import the decorator class for Component 2 | import { Component } from '@angular/core'; 3 | 4 | @Component({ 5 | selector: 'my-app', 6 | templateUrl: 'app/app.component.html' 7 | }) 8 | export class AppComponent {} 9 | -------------------------------------------------------------------------------- /chapter_2/1.ecommerce-seed/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { FormsModule } from '@angular/forms'; 4 | 5 | import { AppComponent } from './app.component'; 6 | 7 | @NgModule({ 8 | imports: [ BrowserModule, FormsModule ], 9 | declarations: [ AppComponent ], 10 | bootstrap: [ AppComponent ] 11 | 12 | }) 13 | export class AppModule { } 14 | -------------------------------------------------------------------------------- /chapter_2/1.ecommerce-seed/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app.module'; 4 | 5 | const platform = platformBrowserDynamic(); 6 | 7 | platform.bootstrapModule(AppModule); 8 | -------------------------------------------------------------------------------- /chapter_2/1.ecommerce-seed/assets/ecommerce.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Web-Development-with-Bootstrap-4-and-Angular-2-Second-Edition/fbe55e446f3489ba2c4909dd5601f4def6994d29/chapter_2/1.ecommerce-seed/assets/ecommerce.css -------------------------------------------------------------------------------- /chapter_2/1.ecommerce-seed/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_2/1.ecommerce-seed/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_2/2.ecommerce-grid/app/app.component.ts: -------------------------------------------------------------------------------- 1 | // Import the decorator class for Component 2 | import { Component } from '@angular/core'; 3 | 4 | @Component({ 5 | selector: 'my-app', 6 | templateUrl: 'app/app.component.html' 7 | }) 8 | export class AppComponent {} 9 | -------------------------------------------------------------------------------- /chapter_2/2.ecommerce-grid/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { FormsModule } from '@angular/forms'; 4 | 5 | import { AppComponent } from './app.component'; 6 | 7 | @NgModule({ 8 | imports: [ BrowserModule, FormsModule ], 9 | declarations: [ AppComponent ], 10 | bootstrap: [ AppComponent ] 11 | 12 | }) 13 | export class AppModule { } 14 | -------------------------------------------------------------------------------- /chapter_2/2.ecommerce-grid/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app.module'; 4 | 5 | const platform = platformBrowserDynamic(); 6 | 7 | platform.bootstrapModule(AppModule); 8 | -------------------------------------------------------------------------------- /chapter_2/2.ecommerce-grid/assets/ecommerce.css: -------------------------------------------------------------------------------- 1 | .product-menu { 2 | height: 50px; 3 | margin-top: 22px; 4 | } 5 | 6 | .product-item { 7 | margin-bottom: 25px; 8 | } 9 | -------------------------------------------------------------------------------- /chapter_2/2.ecommerce-grid/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_2/2.ecommerce-grid/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_2/3.ecommerce-cards/app/app.component.ts: -------------------------------------------------------------------------------- 1 | // Import the decorator class for Component 2 | import { Component } from '@angular/core'; 3 | 4 | @Component({ 5 | selector: 'my-app', 6 | templateUrl: 'app/app.component.html' 7 | }) 8 | export class AppComponent {} 9 | -------------------------------------------------------------------------------- /chapter_2/3.ecommerce-cards/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { FormsModule } from '@angular/forms'; 4 | 5 | import { AppComponent } from './app.component'; 6 | 7 | @NgModule({ 8 | imports: [ BrowserModule, FormsModule ], 9 | declarations: [ AppComponent ], 10 | bootstrap: [ AppComponent ] 11 | 12 | }) 13 | export class AppModule { } 14 | -------------------------------------------------------------------------------- /chapter_2/3.ecommerce-cards/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app.module'; 4 | 5 | const platform = platformBrowserDynamic(); 6 | 7 | platform.bootstrapModule(AppModule); 8 | -------------------------------------------------------------------------------- /chapter_2/3.ecommerce-cards/assets/ecommerce.css: -------------------------------------------------------------------------------- 1 | .product-menu { 2 | height: 50px; 3 | margin-top: 22px; 4 | } 5 | 6 | .product-slide-item { 7 | margin-bottom: 25px; 8 | } 9 | 10 | .product-item { 11 | height: 171px; 12 | width: 100%; 13 | display: block; 14 | } 15 | -------------------------------------------------------------------------------- /chapter_2/3.ecommerce-cards/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_2/3.ecommerce-cards/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_2/4.ecommerce-responsive/app/app.component.ts: -------------------------------------------------------------------------------- 1 | // Import the decorator class for Component 2 | import { Component } from '@angular/core'; 3 | 4 | @Component({ 5 | selector: 'my-app', 6 | templateUrl: 'app/app.component.html' 7 | }) 8 | export class AppComponent {} 9 | -------------------------------------------------------------------------------- /chapter_2/4.ecommerce-responsive/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { FormsModule } from '@angular/forms'; 4 | 5 | import { AppComponent } from './app.component'; 6 | 7 | @NgModule({ 8 | imports: [ BrowserModule, FormsModule ], 9 | declarations: [ AppComponent ], 10 | bootstrap: [ AppComponent ] 11 | 12 | }) 13 | export class AppModule { } 14 | -------------------------------------------------------------------------------- /chapter_2/4.ecommerce-responsive/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app.module'; 4 | 5 | const platform = platformBrowserDynamic(); 6 | 7 | platform.bootstrapModule(AppModule); 8 | -------------------------------------------------------------------------------- /chapter_2/4.ecommerce-responsive/assets/ecommerce.css: -------------------------------------------------------------------------------- 1 | .product-menu { 2 | height: 50px; 3 | margin-top: 22px; 4 | } 5 | 6 | .product-slide-item { 7 | margin-bottom: 25px; 8 | } 9 | 10 | .product-item { 11 | height: 171px; 12 | width: 100%; 13 | display: block; 14 | } 15 | 16 | body { 17 | padding-top: 50px; 18 | } -------------------------------------------------------------------------------- /chapter_2/4.ecommerce-responsive/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_2/4.ecommerce-responsive/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_3/1.ecommerce-seed/app/app.component.ts: -------------------------------------------------------------------------------- 1 | // Import the decorator class for Component 2 | import { Component } from '@angular/core'; 3 | 4 | @Component({ 5 | selector: 'my-app', 6 | templateUrl: 'app/app.component.html' 7 | }) 8 | export class AppComponent {} 9 | -------------------------------------------------------------------------------- /chapter_3/1.ecommerce-seed/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { FormsModule } from '@angular/forms'; 4 | 5 | import { AppComponent } from './app.component'; 6 | 7 | @NgModule({ 8 | imports: [ BrowserModule, FormsModule ], 9 | declarations: [ AppComponent ], 10 | bootstrap: [ AppComponent ] 11 | 12 | }) 13 | export class AppModule { } 14 | -------------------------------------------------------------------------------- /chapter_3/1.ecommerce-seed/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app.module'; 4 | 5 | const platform = platformBrowserDynamic(); 6 | 7 | platform.bootstrapModule(AppModule); 8 | -------------------------------------------------------------------------------- /chapter_3/1.ecommerce-seed/assets/ecommerce.css: -------------------------------------------------------------------------------- 1 | .product-menu { 2 | height: 50px; 3 | margin-top: 22px; 4 | } 5 | 6 | .product-slide-item { 7 | margin-bottom: 25px; 8 | } 9 | 10 | .product-item { 11 | height: 171px; 12 | width: 100%; 13 | display: block; 14 | } 15 | 16 | body { 17 | padding-top: 50px; 18 | } -------------------------------------------------------------------------------- /chapter_3/1.ecommerce-seed/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_3/1.ecommerce-seed/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_3/2.ecommerce-jumbotron/app/app.component.ts: -------------------------------------------------------------------------------- 1 | // Import the decorator class for Component 2 | import { Component } from '@angular/core'; 3 | 4 | @Component({ 5 | selector: 'my-app', 6 | templateUrl: 'app/app.component.html' 7 | }) 8 | export class AppComponent {} 9 | -------------------------------------------------------------------------------- /chapter_3/2.ecommerce-jumbotron/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { FormsModule } from '@angular/forms'; 4 | 5 | import { AppComponent } from './app.component'; 6 | 7 | @NgModule({ 8 | imports: [ BrowserModule, FormsModule ], 9 | declarations: [ AppComponent ], 10 | bootstrap: [ AppComponent ] 11 | 12 | }) 13 | export class AppModule { } 14 | -------------------------------------------------------------------------------- /chapter_3/2.ecommerce-jumbotron/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app.module'; 4 | 5 | const platform = platformBrowserDynamic(); 6 | 7 | platform.bootstrapModule(AppModule); 8 | -------------------------------------------------------------------------------- /chapter_3/2.ecommerce-jumbotron/assets/ecommerce.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | } 4 | 5 | .product-menu { 6 | height: 50px; 7 | margin-top: 22px; 8 | } 9 | 10 | .product-slide-item { 11 | margin-bottom: 25px; 12 | } 13 | 14 | .product-item { 15 | height: 171px; 16 | width: 100%; 17 | display: block; 18 | } 19 | 20 | .marketing { 21 | background-color: #f6eee3; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /chapter_3/2.ecommerce-jumbotron/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_3/2.ecommerce-jumbotron/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_3/3.ecommerce-carousel/app/app.component.ts: -------------------------------------------------------------------------------- 1 | // Import the decorator class for Component 2 | import { Component } from '@angular/core'; 3 | 4 | @Component({ 5 | selector: 'my-app', 6 | templateUrl: 'app/app.component.html' 7 | }) 8 | export class AppComponent {} 9 | -------------------------------------------------------------------------------- /chapter_3/3.ecommerce-carousel/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { FormsModule } from '@angular/forms'; 4 | 5 | import { AppComponent } from './app.component'; 6 | 7 | @NgModule({ 8 | imports: [ BrowserModule, FormsModule ], 9 | declarations: [ AppComponent ], 10 | bootstrap: [ AppComponent ] 11 | 12 | }) 13 | export class AppModule { } 14 | -------------------------------------------------------------------------------- /chapter_3/3.ecommerce-carousel/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app.module'; 4 | 5 | const platform = platformBrowserDynamic(); 6 | 7 | platform.bootstrapModule(AppModule); 8 | -------------------------------------------------------------------------------- /chapter_3/3.ecommerce-carousel/assets/ecommerce.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | } 4 | 5 | .product-menu { 6 | height: 50px; 7 | margin-top: 22px; 8 | } 9 | 10 | .product-slide-item { 11 | margin-bottom: 25px; 12 | } 13 | 14 | .product-item { 15 | height: 171px; 16 | width: 100%; 17 | display: block; 18 | } 19 | 20 | .marketing { 21 | background-color: #f6eee3; 22 | } 23 | 24 | .carousel { 25 | margin-bottom: 12px; 26 | } 27 | 28 | .footer { 29 | padding-top: 5px; 30 | background-color: #f5f5f5; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /chapter_3/3.ecommerce-carousel/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } -------------------------------------------------------------------------------- /chapter_3/3.ecommerce-carousel/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160602141332", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160807145350" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_3/4.ecommerce-input-group/app/app.component.ts: -------------------------------------------------------------------------------- 1 | // Import the decorator class for Component 2 | import { Component } from '@angular/core'; 3 | 4 | @Component({ 5 | selector: 'my-app', 6 | templateUrl: 'app/app.component.html' 7 | }) 8 | export class AppComponent {} 9 | -------------------------------------------------------------------------------- /chapter_3/4.ecommerce-input-group/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { FormsModule } from '@angular/forms'; 4 | 5 | import { AppComponent } from './app.component'; 6 | 7 | @NgModule({ 8 | imports: [ BrowserModule, FormsModule ], 9 | declarations: [ AppComponent ], 10 | bootstrap: [ AppComponent ] 11 | 12 | }) 13 | export class AppModule { } 14 | -------------------------------------------------------------------------------- /chapter_3/4.ecommerce-input-group/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app.module'; 4 | 5 | const platform = platformBrowserDynamic(); 6 | 7 | platform.bootstrapModule(AppModule); 8 | -------------------------------------------------------------------------------- /chapter_3/4.ecommerce-input-group/assets/ecommerce.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 60px; 3 | } 4 | 5 | .product-menu { 6 | height: 50px; 7 | margin-top: 22px; 8 | } 9 | 10 | .product-slide-item { 11 | margin-bottom: 25px; 12 | } 13 | 14 | .product-item { 15 | height: 171px; 16 | width: 100%; 17 | display: block; 18 | } 19 | 20 | .marketing { 21 | background-color: #f6eee3; 22 | } 23 | 24 | .carousel { 25 | margin-bottom: 12px; 26 | } 27 | 28 | .footer { 29 | padding-top: 5px; 30 | background-color: #f5f5f5; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /chapter_3/4.ecommerce-input-group/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_3/4.ecommerce-input-group/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_3/5.ecommerce-list-group/app/app.component.ts: -------------------------------------------------------------------------------- 1 | // Import the decorator class for Component 2 | import { Component } from '@angular/core'; 3 | 4 | @Component({ 5 | selector: 'my-app', 6 | templateUrl: 'app/app.component.html' 7 | }) 8 | export class AppComponent {} 9 | -------------------------------------------------------------------------------- /chapter_3/5.ecommerce-list-group/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { FormsModule } from '@angular/forms'; 4 | 5 | import { AppComponent } from './app.component'; 6 | 7 | @NgModule({ 8 | imports: [ BrowserModule, FormsModule ], 9 | declarations: [ AppComponent ], 10 | bootstrap: [ AppComponent ] 11 | 12 | }) 13 | export class AppModule { } 14 | -------------------------------------------------------------------------------- /chapter_3/5.ecommerce-list-group/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app.module'; 4 | 5 | const platform = platformBrowserDynamic(); 6 | 7 | platform.bootstrapModule(AppModule); 8 | -------------------------------------------------------------------------------- /chapter_3/5.ecommerce-list-group/assets/ecommerce.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 60px; 3 | } 4 | 5 | .product-menu { 6 | height: 50px; 7 | margin-top: 22px; 8 | } 9 | 10 | .product-slide-item { 11 | margin-bottom: 25px; 12 | } 13 | 14 | .product-item { 15 | height: 171px; 16 | width: 100%; 17 | display: block; 18 | } 19 | 20 | .marketing { 21 | background-color: #f6eee3; 22 | } 23 | 24 | .carousel { 25 | margin-bottom: 12px; 26 | } 27 | 28 | .footer { 29 | padding-top: 5px; 30 | background-color: #f5f5f5; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /chapter_3/5.ecommerce-list-group/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_3/5.ecommerce-list-group/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_3/6.ecommerce-grid-in-grid/app/app.component.ts: -------------------------------------------------------------------------------- 1 | // Import the decorator class for Component 2 | import { Component } from '@angular/core'; 3 | 4 | @Component({ 5 | selector: 'my-app', 6 | templateUrl: 'app/app.component.html' 7 | }) 8 | export class AppComponent {} 9 | -------------------------------------------------------------------------------- /chapter_3/6.ecommerce-grid-in-grid/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { FormsModule } from '@angular/forms'; 4 | 5 | import { AppComponent } from './app.component'; 6 | 7 | @NgModule({ 8 | imports: [ BrowserModule, FormsModule ], 9 | declarations: [ AppComponent ], 10 | bootstrap: [ AppComponent ] 11 | 12 | }) 13 | export class AppModule { } 14 | -------------------------------------------------------------------------------- /chapter_3/6.ecommerce-grid-in-grid/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app.module'; 4 | 5 | const platform = platformBrowserDynamic(); 6 | 7 | platform.bootstrapModule(AppModule); 8 | -------------------------------------------------------------------------------- /chapter_3/6.ecommerce-grid-in-grid/assets/ecommerce.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 60px; 3 | } 4 | 5 | .product-menu { 6 | height: 50px; 7 | margin-top: 22px; 8 | } 9 | 10 | .product-slide-item { 11 | margin-bottom: 25px; 12 | } 13 | 14 | .product-item { 15 | height: 171px; 16 | width: 100%; 17 | display: block; 18 | } 19 | 20 | .marketing { 21 | background-color: #f6eee3; 22 | } 23 | 24 | .carousel { 25 | margin-bottom: 12px; 26 | } 27 | 28 | .footer { 29 | padding-top: 5px; 30 | background-color: #f5f5f5; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /chapter_3/6.ecommerce-grid-in-grid/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_3/6.ecommerce-grid-in-grid/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_3/7.ecommerce-dropdown/app/app.component.ts: -------------------------------------------------------------------------------- 1 | // Import the decorator class for Component 2 | import { Component } from '@angular/core'; 3 | 4 | @Component({ 5 | selector: 'my-app', 6 | templateUrl: 'app/app.component.html' 7 | }) 8 | export class AppComponent {} 9 | -------------------------------------------------------------------------------- /chapter_3/7.ecommerce-dropdown/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { FormsModule } from '@angular/forms'; 4 | 5 | import { AppComponent } from './app.component'; 6 | 7 | @NgModule({ 8 | imports: [ BrowserModule, FormsModule ], 9 | declarations: [ AppComponent ], 10 | bootstrap: [ AppComponent ] 11 | 12 | }) 13 | export class AppModule { } 14 | -------------------------------------------------------------------------------- /chapter_3/7.ecommerce-dropdown/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app.module'; 4 | 5 | const platform = platformBrowserDynamic(); 6 | 7 | platform.bootstrapModule(AppModule); 8 | -------------------------------------------------------------------------------- /chapter_3/7.ecommerce-dropdown/assets/ecommerce.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 60px; 3 | } 4 | 5 | .product-menu { 6 | height: 50px; 7 | margin-top: 22px; 8 | } 9 | 10 | .product-slide-item { 11 | margin-bottom: 25px; 12 | } 13 | 14 | .product-item { 15 | height: 171px; 16 | width: 100%; 17 | display: block; 18 | } 19 | 20 | .marketing { 21 | background-color: #f6eee3; 22 | } 23 | 24 | .carousel { 25 | margin-bottom: 12px; 26 | } 27 | 28 | .footer { 29 | padding-top: 5px; 30 | background-color: #f5f5f5; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /chapter_3/7.ecommerce-dropdown/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_3/7.ecommerce-dropdown/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_4/1.ecommerce-seed/app/app.component.ts: -------------------------------------------------------------------------------- 1 | // Import the decorator class for Component 2 | import { Component } from '@angular/core'; 3 | 4 | @Component({ 5 | selector: 'my-app', 6 | templateUrl: 'app/app.component.html' 7 | }) 8 | export class AppComponent {} 9 | -------------------------------------------------------------------------------- /chapter_4/1.ecommerce-seed/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { FormsModule } from '@angular/forms'; 4 | 5 | import { AppComponent } from './app.component'; 6 | 7 | @NgModule({ 8 | imports: [ BrowserModule, FormsModule ], 9 | declarations: [ AppComponent ], 10 | bootstrap: [ AppComponent ] 11 | 12 | }) 13 | export class AppModule { } 14 | -------------------------------------------------------------------------------- /chapter_4/1.ecommerce-seed/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app.module'; 4 | 5 | const platform = platformBrowserDynamic(); 6 | 7 | platform.bootstrapModule(AppModule); 8 | -------------------------------------------------------------------------------- /chapter_4/1.ecommerce-seed/assets/ecommerce.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 60px; 3 | } 4 | 5 | .product-menu { 6 | height: 50px; 7 | margin-top: 22px; 8 | } 9 | 10 | .product-slide-item { 11 | margin-bottom: 25px; 12 | } 13 | 14 | .product-item { 15 | height: 171px; 16 | width: 100%; 17 | display: block; 18 | } 19 | 20 | .marketing { 21 | background-color: #f6eee3; 22 | } 23 | 24 | .carousel { 25 | margin-bottom: 12px; 26 | } 27 | 28 | .footer { 29 | padding-top: 5px; 30 | background-color: #f5f5f5; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /chapter_4/1.ecommerce-seed/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_4/1.ecommerce-seed/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_4/2.ecommerce-navbar/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'my-app', 8 | templateUrl: 'app/app.component.html' 9 | }) 10 | export class AppComponent { } 11 | -------------------------------------------------------------------------------- /chapter_4/2.ecommerce-navbar/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | 4 | /* 5 | * Components 6 | */ 7 | import { AppComponent } from './app.component'; 8 | import { NavbarComponent } from './navbar/navbar.component'; 9 | 10 | @NgModule({ 11 | imports: [BrowserModule], 12 | declarations: [AppComponent, NavbarComponent], 13 | bootstrap: [AppComponent] 14 | }) 15 | export class AppModule { } 16 | -------------------------------------------------------------------------------- /chapter_4/2.ecommerce-navbar/app/main.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; 5 | 6 | /* 7 | * The app module 8 | */ 9 | import {AppModule} from './app.module'; 10 | 11 | /* 12 | * Bootstrap out application 13 | */ 14 | platformBrowserDynamic().bootstrapModule(AppModule); 15 | -------------------------------------------------------------------------------- /chapter_4/2.ecommerce-navbar/assets/ecommerce.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | } 4 | 5 | .product-menu { 6 | height: 50px; 7 | margin-top: 22px; 8 | } 9 | 10 | .product-slide-item { 11 | margin-bottom: 25px; 12 | } 13 | 14 | .product-item { 15 | height: 171px; 16 | width: 100%; 17 | display: block; 18 | } 19 | 20 | .marketing { 21 | background-color: #f6eee3; 22 | } 23 | 24 | .carousel { 25 | margin-bottom: 12px; 26 | } 27 | 28 | .footer { 29 | padding-top: 5px; 30 | background-color: #f5f5f5; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /chapter_4/2.ecommerce-navbar/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_4/2.ecommerce-navbar/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_4/3.ecommerce-category/app/category/category-card.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{category.title}} 4 |
5 |

{{category.title}}

6 |

{{category.desc}}

7 | 8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /chapter_4/3.ecommerce-category/app/category/category-card.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, Input, Output, EventEmitter} from '@angular/core'; 2 | 3 | import {Category} from './category'; 4 | 5 | @Component({ 6 | selector: 'db-category-card', 7 | templateUrl: 'app/category/category-card.component.html' 8 | }) 9 | export class CategoryCardComponent { 10 | @Input() category: Category; 11 | @Output() select: EventEmitter = new EventEmitter(); 12 | 13 | browse() { 14 | this.select.emit(this.category); 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /chapter_4/3.ecommerce-category/app/category/category-slide.component.html: -------------------------------------------------------------------------------- 1 | {{category.title}} 2 | -------------------------------------------------------------------------------- /chapter_4/3.ecommerce-category/app/category/category-slide.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, Input, Output, EventEmitter} from '@angular/core'; 2 | 3 | import {Category} from './category'; 4 | 5 | @Component({ 6 | selector: 'db-category-slide', 7 | templateUrl: 'app/category/category-slide.component.html' 8 | }) 9 | export class CategorySlideComponent { 10 | @Input() category: Category; 11 | @Output() select: EventEmitter = new EventEmitter(); 12 | 13 | browse() { 14 | this.select.emit(this.category); 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /chapter_4/3.ecommerce-category/app/category/category.ts: -------------------------------------------------------------------------------- 1 | export class Category { 2 | // Unique Id 3 | id: string; 4 | // The title 5 | title: string; 6 | // Description 7 | desc: string; 8 | // Path to image 9 | image: string; 10 | } -------------------------------------------------------------------------------- /chapter_4/3.ecommerce-category/app/main.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; 5 | 6 | /* 7 | * The app module 8 | */ 9 | import {AppModule} from './app.module'; 10 | 11 | /* 12 | * Bootstrap out application 13 | */ 14 | platformBrowserDynamic().bootstrapModule(AppModule); 15 | -------------------------------------------------------------------------------- /chapter_4/3.ecommerce-category/assets/ecommerce.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | } 4 | 5 | .product-menu { 6 | height: 50px; 7 | margin-top: 22px; 8 | } 9 | 10 | .product-slide-item { 11 | margin-bottom: 25px; 12 | } 13 | 14 | .product-item { 15 | height: 171px; 16 | width: 100%; 17 | display: block; 18 | } 19 | 20 | .marketing { 21 | background-color: #f6eee3; 22 | } 23 | 24 | .carousel { 25 | margin-bottom: 12px; 26 | } 27 | 28 | .footer { 29 | padding-top: 5px; 30 | background-color: #f5f5f5; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /chapter_4/3.ecommerce-category/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_4/3.ecommerce-category/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_5/1.ecommerce-seed/app/category/category-card.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{category.title}} 4 |
5 |

{{category.title}}

6 |

{{category.desc}}

7 | 8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /chapter_5/1.ecommerce-seed/app/category/category-card.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, Input, Output, EventEmitter} from '@angular/core'; 2 | 3 | import {Category} from './category'; 4 | 5 | @Component({ 6 | selector: 'db-category-card', 7 | templateUrl: 'app/category/category-card.component.html' 8 | }) 9 | export class CategoryCardComponent { 10 | @Input() category: Category; 11 | @Output() select: EventEmitter = new EventEmitter(); 12 | 13 | browse() { 14 | this.select.emit(this.category); 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /chapter_5/1.ecommerce-seed/app/category/category-slide.component.html: -------------------------------------------------------------------------------- 1 | {{category.title}} 2 | -------------------------------------------------------------------------------- /chapter_5/1.ecommerce-seed/app/category/category-slide.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, Input, Output, EventEmitter} from '@angular/core'; 2 | 3 | import {Category} from './category'; 4 | 5 | @Component({ 6 | selector: 'db-category-slide', 7 | templateUrl: 'app/category/category-slide.component.html' 8 | }) 9 | export class CategorySlideComponent { 10 | @Input() category: Category; 11 | @Output() select: EventEmitter = new EventEmitter(); 12 | 13 | browse() { 14 | this.select.emit(this.category); 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /chapter_5/1.ecommerce-seed/app/category/category.ts: -------------------------------------------------------------------------------- 1 | export class Category { 2 | // Unique Id 3 | id: string; 4 | // The title 5 | title: string; 6 | // Description 7 | desc: string; 8 | // Path to image 9 | image: string; 10 | } -------------------------------------------------------------------------------- /chapter_5/1.ecommerce-seed/app/main.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; 5 | 6 | /* 7 | * The app module 8 | */ 9 | import {AppModule} from './app.module'; 10 | 11 | /* 12 | * Bootstrap out application 13 | */ 14 | platformBrowserDynamic().bootstrapModule(AppModule); 15 | -------------------------------------------------------------------------------- /chapter_5/1.ecommerce-seed/assets/ecommerce.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | } 4 | 5 | .product-menu { 6 | height: 50px; 7 | margin-top: 22px; 8 | } 9 | 10 | .product-slide-item { 11 | margin-bottom: 25px; 12 | } 13 | 14 | .product-item { 15 | height: 171px; 16 | width: 100%; 17 | display: block; 18 | } 19 | 20 | .marketing { 21 | background-color: #f6eee3; 22 | } 23 | 24 | .carousel { 25 | margin-bottom: 12px; 26 | } 27 | 28 | .footer { 29 | padding-top: 5px; 30 | background-color: #f5f5f5; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /chapter_5/1.ecommerce-seed/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_5/1.ecommerce-seed/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_5/2.ecommerce-router/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /chapter_5/2.ecommerce-router/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'my-app', 8 | templateUrl: 'app/app.component.html', 9 | }) 10 | export class AppComponent { } 11 | -------------------------------------------------------------------------------- /chapter_5/2.ecommerce-router/app/category/category-card.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{category.title}} 4 |
5 |

{{category.title}}

6 |

{{category.desc}}

7 | 8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /chapter_5/2.ecommerce-router/app/category/category-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Categories
3 | 7 |
8 | -------------------------------------------------------------------------------- /chapter_5/2.ecommerce-router/app/category/category-slide.component.html: -------------------------------------------------------------------------------- 1 | {{category.title}} 2 | -------------------------------------------------------------------------------- /chapter_5/2.ecommerce-router/app/category/category-slide.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input, Output, EventEmitter} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Category} from './category'; 10 | 11 | @Component({ 12 | selector: 'db-category-slide', 13 | templateUrl: 'app/category/category-slide.component.html' 14 | }) 15 | export class CategorySlideComponent { 16 | @Input() category: Category; 17 | @Output() select: EventEmitter = new EventEmitter(); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter_5/2.ecommerce-router/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Contact Info
5 | 0000 Market St, Suite 000, San Francisco, CA 00000, (123) 456-7890, support@dream-bean.com 6 |
7 |
8 |
-------------------------------------------------------------------------------- /chapter_5/2.ecommerce-router/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Components 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-footer', 8 | templateUrl: 'app/footer/footer.component.html' 9 | }) 10 | export class FooterComponent { } 11 | -------------------------------------------------------------------------------- /chapter_5/2.ecommerce-router/app/main.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; 5 | 6 | /* 7 | * The app module 8 | */ 9 | import {AppModule} from './app.module'; 10 | 11 | /* 12 | * Bootstrap out application 13 | */ 14 | platformBrowserDynamic().bootstrapModule(AppModule); 15 | -------------------------------------------------------------------------------- /chapter_5/2.ecommerce-router/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import { Component } from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-navbar', 8 | templateUrl: 'app/navbar/navbar.component.html' 9 | }) 10 | export class NavbarComponent { } 11 | 12 | -------------------------------------------------------------------------------- /chapter_5/2.ecommerce-router/app/product/product-grid.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_5/2.ecommerce-router/app/product/product-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 |
10 |
11 |
-------------------------------------------------------------------------------- /chapter_5/2.ecommerce-router/app/product/product-list.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | 10 | @Component({ 11 | selector: 'db-products', 12 | templateUrl: 'app/product/product-list.component.html' 13 | }) 14 | export class ProductListComponent {} 15 | -------------------------------------------------------------------------------- /chapter_5/2.ecommerce-router/app/product/product-search.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Quick Shop
3 |
4 | 5 | 6 | 7 | 8 |
9 |
-------------------------------------------------------------------------------- /chapter_5/2.ecommerce-router/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_5/2.ecommerce-router/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_5/3.ecommerce-router-search/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /chapter_5/3.ecommerce-router-search/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'my-app', 8 | templateUrl: 'app/app.component.html', 9 | }) 10 | export class AppComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_5/3.ecommerce-router-search/app/category/category-card.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{category.title}} 4 |
5 |

{{category.title}}

6 |

{{category.desc}}

7 | 8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /chapter_5/3.ecommerce-router-search/app/category/category-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Categories
3 | 7 |
8 | -------------------------------------------------------------------------------- /chapter_5/3.ecommerce-router-search/app/category/category-slide.component.html: -------------------------------------------------------------------------------- 1 | {{category.title}} 2 | -------------------------------------------------------------------------------- /chapter_5/3.ecommerce-router-search/app/category/category-slide.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input, Output, EventEmitter} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Category} from './category'; 10 | 11 | @Component({ 12 | selector: 'db-category-slide', 13 | templateUrl: 'app/category/category-slide.component.html' 14 | }) 15 | export class CategorySlideComponent { 16 | @Input() category: Category; 17 | @Output() select: EventEmitter = new EventEmitter(); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter_5/3.ecommerce-router-search/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Contact Info
5 | 0000 Market St, Suite 000, San Francisco, CA 00000, (123) 456-7890, support@dream-bean.com 6 |
7 |
8 |
-------------------------------------------------------------------------------- /chapter_5/3.ecommerce-router-search/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Components 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-footer', 8 | templateUrl: 'app/footer/footer.component.html' 9 | }) 10 | export class FooterComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_5/3.ecommerce-router-search/app/main.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; 5 | 6 | /* 7 | * The app module 8 | */ 9 | import {AppModule} from './app.module'; 10 | 11 | /* 12 | * Bootstrap out application 13 | */ 14 | platformBrowserDynamic().bootstrapModule(AppModule); 15 | -------------------------------------------------------------------------------- /chapter_5/3.ecommerce-router-search/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import { Component } from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-navbar', 8 | templateUrl: 'app/navbar/navbar.component.html' 9 | }) 10 | export class NavbarComponent { } 11 | 12 | -------------------------------------------------------------------------------- /chapter_5/3.ecommerce-router-search/app/product/product-grid.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_5/3.ecommerce-router-search/app/product/product-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 |
10 |
11 |
-------------------------------------------------------------------------------- /chapter_5/3.ecommerce-router-search/app/product/product-list.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | 10 | @Component({ 11 | selector: 'db-products', 12 | templateUrl: 'app/product/product-list.component.html' 13 | }) 14 | export class ProductListComponent {} 15 | -------------------------------------------------------------------------------- /chapter_5/3.ecommerce-router-search/app/product/product-search.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Quick Shop
3 |
4 | 5 | 6 | 7 | 8 |
9 |
-------------------------------------------------------------------------------- /chapter_5/3.ecommerce-router-search/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } -------------------------------------------------------------------------------- /chapter_5/3.ecommerce-router-search/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160602141332", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160807145350" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_6/1.ecommerce-seed/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /chapter_6/1.ecommerce-seed/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'my-app', 8 | templateUrl: 'app/app.component.html', 9 | }) 10 | export class AppComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_6/1.ecommerce-seed/app/category/category-card.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{category.title}} 4 |
5 |

{{category.title}}

6 |

{{category.desc}}

7 | 8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /chapter_6/1.ecommerce-seed/app/category/category-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Categories
3 | 7 |
8 | -------------------------------------------------------------------------------- /chapter_6/1.ecommerce-seed/app/category/category-slide.component.html: -------------------------------------------------------------------------------- 1 | {{category.title}} 2 | -------------------------------------------------------------------------------- /chapter_6/1.ecommerce-seed/app/category/category-slide.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input, Output, EventEmitter} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Category} from './category'; 10 | 11 | @Component({ 12 | selector: 'db-category-slide', 13 | templateUrl: 'app/category/category-slide.component.html' 14 | }) 15 | export class CategorySlideComponent { 16 | @Input() category: Category; 17 | @Output() select: EventEmitter = new EventEmitter(); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter_6/1.ecommerce-seed/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Contact Info
5 | 0000 Market St, Suite 000, San Francisco, CA 00000, (123) 456-7890, support@dream-bean.com 6 |
7 |
8 |
-------------------------------------------------------------------------------- /chapter_6/1.ecommerce-seed/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Components 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-footer', 8 | templateUrl: 'app/footer/footer.component.html' 9 | }) 10 | export class FooterComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_6/1.ecommerce-seed/app/main.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; 5 | 6 | /* 7 | * The app module 8 | */ 9 | import {AppModule} from './app.module'; 10 | 11 | /* 12 | * Bootstrap out application 13 | */ 14 | platformBrowserDynamic().bootstrapModule(AppModule); 15 | -------------------------------------------------------------------------------- /chapter_6/1.ecommerce-seed/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import { Component } from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-navbar', 8 | templateUrl: 'app/navbar/navbar.component.html' 9 | }) 10 | export class NavbarComponent { } 11 | 12 | -------------------------------------------------------------------------------- /chapter_6/1.ecommerce-seed/app/product/product-grid.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_6/1.ecommerce-seed/app/product/product-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 |
10 |
11 |
-------------------------------------------------------------------------------- /chapter_6/1.ecommerce-seed/app/product/product-list.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | 10 | @Component({ 11 | selector: 'db-products', 12 | templateUrl: 'app/product/product-list.component.html' 13 | }) 14 | export class ProductListComponent {} 15 | -------------------------------------------------------------------------------- /chapter_6/1.ecommerce-seed/app/product/product-search.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Quick Shop
3 |
4 | 5 | 6 | 7 | 8 |
9 |
-------------------------------------------------------------------------------- /chapter_6/1.ecommerce-seed/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } -------------------------------------------------------------------------------- /chapter_6/1.ecommerce-seed/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160602141332", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160807145350" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_6/2.ecommerce-di/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /chapter_6/2.ecommerce-di/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'my-app', 8 | templateUrl: 'app/app.component.html' 9 | }) 10 | export class AppComponent {} 11 | -------------------------------------------------------------------------------- /chapter_6/2.ecommerce-di/app/category/category-card.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{category.title}} 4 |
5 |

{{category.title}}

6 |

{{category.desc}}

7 | 8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /chapter_6/2.ecommerce-di/app/category/category-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Categories
3 | 7 |
-------------------------------------------------------------------------------- /chapter_6/2.ecommerce-di/app/category/category-slide.component.html: -------------------------------------------------------------------------------- 1 | {{category.title}} 2 | -------------------------------------------------------------------------------- /chapter_6/2.ecommerce-di/app/category/category-slide.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input, Output, EventEmitter} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Category} from './category.service'; 10 | 11 | @Component({ 12 | selector: 'db-category-slide', 13 | templateUrl: 'app/category/category-slide.component.html' 14 | }) 15 | export class CategorySlideComponent { 16 | @Input() category: Category; 17 | @Output() select: EventEmitter = new EventEmitter(); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter_6/2.ecommerce-di/app/category/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Exports 3 | */ 4 | export * from './category.service'; 5 | export * from './category-card.component'; 6 | export * from './category-slide.component'; 7 | export * from './category-list.component'; -------------------------------------------------------------------------------- /chapter_6/2.ecommerce-di/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Contact Info
5 | 0000 Market St, Suite 000, San Francisco, CA 00000, (123) 456-7890, support@dream-bean.com 6 |
7 |
8 |
-------------------------------------------------------------------------------- /chapter_6/2.ecommerce-di/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Components 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-footer', 8 | templateUrl: 'app/footer/footer.component.html' 9 | }) 10 | export class FooterComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_6/2.ecommerce-di/app/main.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 5 | 6 | import { AppModule } from './app.module'; 7 | 8 | const platform = platformBrowserDynamic(); 9 | 10 | platform.bootstrapModule(AppModule); 11 | 12 | -------------------------------------------------------------------------------- /chapter_6/2.ecommerce-di/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import { Component } from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-navbar', 8 | templateUrl: 'app/navbar/navbar.component.html' 9 | }) 10 | export class NavbarComponent { } 11 | 12 | -------------------------------------------------------------------------------- /chapter_6/2.ecommerce-di/app/product/product-grid.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_6/2.ecommerce-di/app/product/product-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 |
10 |
11 |
-------------------------------------------------------------------------------- /chapter_6/2.ecommerce-di/app/product/product-list.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | 10 | @Component({ 11 | selector: 'db-products', 12 | templateUrl: 'app/product/product-list.component.html' 13 | }) 14 | export class ProductListComponent {} 15 | -------------------------------------------------------------------------------- /chapter_6/2.ecommerce-di/app/product/product-search.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Quick Shop
3 |
4 | 5 | 6 | 7 | 8 |
9 |
-------------------------------------------------------------------------------- /chapter_6/2.ecommerce-di/app/product/product-search.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | import {Router} from '@angular/router'; 6 | 7 | @Component({ 8 | selector: 'db-product-search', 9 | templateUrl: 'app/product/product-search.component.html' 10 | }) 11 | export class ProductSearchComponent { 12 | 13 | constructor(private router: Router) {} 14 | 15 | searchProduct(value: string) { 16 | this.router.navigate(['/products'], { queryParams: { search: value} }); 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter_6/2.ecommerce-di/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_6/2.ecommerce-di/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_6/3.ecommerce-cart/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /chapter_6/3.ecommerce-cart/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'my-app', 8 | templateUrl: 'app/app.component.html' 9 | }) 10 | export class AppComponent {} 11 | -------------------------------------------------------------------------------- /chapter_6/3.ecommerce-cart/app/cart/cart-menu.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Cart, CartService} from './cart.service'; 10 | 11 | @Component({ 12 | selector: 'db-cart-menu', 13 | templateUrl: 'app/cart/cart-menu.component.html' 14 | }) 15 | export class CartMenuComponent { 16 | 17 | private cart: Cart; 18 | 19 | constructor(private cartService: CartService) { 20 | this.cart = this.cartService.cart; 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /chapter_6/3.ecommerce-cart/app/category/category-card.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{category.title}} 4 |
5 |

{{category.title}}

6 |

{{category.desc}}

7 | 8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /chapter_6/3.ecommerce-cart/app/category/category-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Categories
3 | 7 |
-------------------------------------------------------------------------------- /chapter_6/3.ecommerce-cart/app/category/category-slide.component.html: -------------------------------------------------------------------------------- 1 | {{category.title}} 2 | -------------------------------------------------------------------------------- /chapter_6/3.ecommerce-cart/app/category/category-slide.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input, Output, EventEmitter} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Category} from './category.service'; 10 | 11 | @Component({ 12 | selector: 'db-category-slide', 13 | templateUrl: 'app/category/category-slide.component.html' 14 | }) 15 | export class CategorySlideComponent { 16 | @Input() category: Category; 17 | @Output() select: EventEmitter = new EventEmitter(); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter_6/3.ecommerce-cart/app/category/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Exports 3 | */ 4 | export * from './category.service'; 5 | export * from './category-card.component'; 6 | export * from './category-slide.component'; 7 | export * from './category-list.component'; -------------------------------------------------------------------------------- /chapter_6/3.ecommerce-cart/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Contact Info
5 | 0000 Market St, Suite 000, San Francisco, CA 00000, (123) 456-7890, support@dream-bean.com 6 |
7 |
8 |
-------------------------------------------------------------------------------- /chapter_6/3.ecommerce-cart/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Components 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-footer', 8 | templateUrl: 'app/footer/footer.component.html' 9 | }) 10 | export class FooterComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_6/3.ecommerce-cart/app/main.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 5 | 6 | import { AppModule } from './app.module'; 7 | 8 | const platform = platformBrowserDynamic(); 9 | 10 | platform.bootstrapModule(AppModule); 11 | 12 | -------------------------------------------------------------------------------- /chapter_6/3.ecommerce-cart/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import { Component } from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-navbar', 8 | templateUrl: 'app/navbar/navbar.component.html' 9 | }) 10 | export class NavbarComponent { } 11 | -------------------------------------------------------------------------------- /chapter_6/3.ecommerce-cart/app/product/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Exports 3 | */ 4 | export * from './product.service'; 5 | export * from './product-search.component'; 6 | export * from './product-list.component'; 7 | export * from './product-card.component'; -------------------------------------------------------------------------------- /chapter_6/3.ecommerce-cart/app/product/product-grid.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_6/3.ecommerce-cart/app/product/product-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 |
10 |
11 |
-------------------------------------------------------------------------------- /chapter_6/3.ecommerce-cart/app/product/product-list.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | 10 | @Component({ 11 | selector: 'db-products', 12 | templateUrl: 'app/product/product-list.component.html' 13 | }) 14 | export class ProductListComponent {} 15 | -------------------------------------------------------------------------------- /chapter_6/3.ecommerce-cart/app/product/product-search.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Quick Shop
3 |
4 | 5 | 6 | 7 | 8 |
9 |
-------------------------------------------------------------------------------- /chapter_6/3.ecommerce-cart/app/product/product-search.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | import {Router} from '@angular/router'; 6 | 7 | @Component({ 8 | selector: 'db-product-search', 9 | templateUrl: 'app/product/product-search.component.html' 10 | }) 11 | export class ProductSearchComponent { 12 | 13 | constructor(private router: Router) {} 14 | 15 | searchProduct(value: string) { 16 | this.router.navigate(['/products'], { queryParams: { search: value} }); 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter_6/3.ecommerce-cart/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_6/3.ecommerce-cart/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_7/1.ecommerce-seed/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /chapter_7/1.ecommerce-seed/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'my-app', 8 | templateUrl: 'app/app.component.html' 9 | }) 10 | export class AppComponent {} 11 | -------------------------------------------------------------------------------- /chapter_7/1.ecommerce-seed/app/cart/cart-menu.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Cart, CartService} from './cart.service'; 10 | 11 | @Component({ 12 | selector: 'db-cart-menu', 13 | templateUrl: 'app/cart/cart-menu.component.html' 14 | }) 15 | export class CartMenuComponent { 16 | 17 | private cart: Cart; 18 | 19 | constructor(private cartService: CartService) { 20 | this.cart = this.cartService.cart; 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /chapter_7/1.ecommerce-seed/app/category/category-card.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{category.title}} 4 |
5 |

{{category.title}}

6 |

{{category.desc}}

7 | 8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /chapter_7/1.ecommerce-seed/app/category/category-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Categories
3 | 7 |
-------------------------------------------------------------------------------- /chapter_7/1.ecommerce-seed/app/category/category-slide.component.html: -------------------------------------------------------------------------------- 1 | {{category.title}} 2 | -------------------------------------------------------------------------------- /chapter_7/1.ecommerce-seed/app/category/category-slide.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input, Output, EventEmitter} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Category} from './category.service'; 10 | 11 | @Component({ 12 | selector: 'db-category-slide', 13 | templateUrl: 'app/category/category-slide.component.html' 14 | }) 15 | export class CategorySlideComponent { 16 | @Input() category: Category; 17 | @Output() select: EventEmitter = new EventEmitter(); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter_7/1.ecommerce-seed/app/category/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Exports 3 | */ 4 | export * from './category.service'; 5 | export * from './category-card.component'; 6 | export * from './category-slide.component'; 7 | export * from './category-list.component'; -------------------------------------------------------------------------------- /chapter_7/1.ecommerce-seed/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Contact Info
5 | 0000 Market St, Suite 000, San Francisco, CA 00000, (123) 456-7890, support@dream-bean.com 6 |
7 |
8 |
-------------------------------------------------------------------------------- /chapter_7/1.ecommerce-seed/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Components 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-footer', 8 | templateUrl: 'app/footer/footer.component.html' 9 | }) 10 | export class FooterComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_7/1.ecommerce-seed/app/main.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 5 | 6 | import { AppModule } from './app.module'; 7 | 8 | const platform = platformBrowserDynamic(); 9 | 10 | platform.bootstrapModule(AppModule); 11 | 12 | -------------------------------------------------------------------------------- /chapter_7/1.ecommerce-seed/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import { Component } from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-navbar', 8 | templateUrl: 'app/navbar/navbar.component.html' 9 | }) 10 | export class NavbarComponent { } 11 | -------------------------------------------------------------------------------- /chapter_7/1.ecommerce-seed/app/product/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Exports 3 | */ 4 | export * from './product.service'; 5 | export * from './product-search.component'; 6 | export * from './product-list.component'; 7 | export * from './product-card.component'; -------------------------------------------------------------------------------- /chapter_7/1.ecommerce-seed/app/product/product-grid.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_7/1.ecommerce-seed/app/product/product-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 |
10 |
11 |
-------------------------------------------------------------------------------- /chapter_7/1.ecommerce-seed/app/product/product-list.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | 10 | @Component({ 11 | selector: 'db-products', 12 | templateUrl: 'app/product/product-list.component.html' 13 | }) 14 | export class ProductListComponent {} 15 | -------------------------------------------------------------------------------- /chapter_7/1.ecommerce-seed/app/product/product-search.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Quick Shop
3 |
4 | 5 | 6 | 7 | 8 |
9 |
-------------------------------------------------------------------------------- /chapter_7/1.ecommerce-seed/app/product/product-search.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | import {Router} from '@angular/router'; 6 | 7 | @Component({ 8 | selector: 'db-product-search', 9 | templateUrl: 'app/product/product-search.component.html' 10 | }) 11 | export class ProductSearchComponent { 12 | 13 | constructor(private router: Router) {} 14 | 15 | searchProduct(value: string) { 16 | this.router.navigate(['/products'], { queryParams: { search: value} }); 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter_7/1.ecommerce-seed/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_7/1.ecommerce-seed/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_7/2.ecommerce-key-event-listenning/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /chapter_7/2.ecommerce-key-event-listenning/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'my-app', 8 | templateUrl: 'app/app.component.html' 9 | }) 10 | export class AppComponent {} 11 | -------------------------------------------------------------------------------- /chapter_7/2.ecommerce-key-event-listenning/app/category/category-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Categories
3 | 7 |
-------------------------------------------------------------------------------- /chapter_7/2.ecommerce-key-event-listenning/app/category/category-slide.component.html: -------------------------------------------------------------------------------- 1 | {{category.title}} 2 | -------------------------------------------------------------------------------- /chapter_7/2.ecommerce-key-event-listenning/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Contact Info
5 | 0000 Market St, Suite 000, San Francisco, CA 00000, (123) 456-7890, support@dream-bean.com 6 |
7 |
8 |
-------------------------------------------------------------------------------- /chapter_7/2.ecommerce-key-event-listenning/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Components 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-footer', 8 | templateUrl: 'app/footer/footer.component.html' 9 | }) 10 | export class FooterComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_7/2.ecommerce-key-event-listenning/app/main.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 5 | 6 | import { AppModule } from './app.module'; 7 | 8 | const platform = platformBrowserDynamic(); 9 | 10 | platform.bootstrapModule(AppModule); 11 | -------------------------------------------------------------------------------- /chapter_7/2.ecommerce-key-event-listenning/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import { Component } from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-navbar', 8 | templateUrl: 'app/navbar/navbar.component.html' 9 | }) 10 | export class NavbarComponent { } 11 | -------------------------------------------------------------------------------- /chapter_7/2.ecommerce-key-event-listenning/app/product/product-grid.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_7/2.ecommerce-key-event-listenning/app/product/product-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 |
10 |
11 |
-------------------------------------------------------------------------------- /chapter_7/2.ecommerce-key-event-listenning/app/product/product-list.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | 10 | @Component({ 11 | selector: 'db-products', 12 | templateUrl: 'app/product/product-list.component.html' 13 | }) 14 | export class ProductListComponent {} 15 | -------------------------------------------------------------------------------- /chapter_7/2.ecommerce-key-event-listenning/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_7/2.ecommerce-key-event-listenning/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_7/3.ecommerce-product-view/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /chapter_7/3.ecommerce-product-view/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'my-app', 8 | templateUrl: 'app/app.component.html' 9 | }) 10 | export class AppComponent {} 11 | -------------------------------------------------------------------------------- /chapter_7/3.ecommerce-product-view/app/cart/cart-menu.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Cart, CartService} from './cart.service'; 10 | 11 | @Component({ 12 | selector: 'db-cart-menu', 13 | templateUrl: 'app/cart/cart-menu.component.html' 14 | }) 15 | export class CartMenuComponent { 16 | 17 | private cart: Cart; 18 | 19 | constructor(private cartService: CartService) { 20 | this.cart = this.cartService.cart; 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /chapter_7/3.ecommerce-product-view/app/category/category-card.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{category.title}} 4 |
5 |

{{category.title}}

6 |

{{category.desc}}

7 | 8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /chapter_7/3.ecommerce-product-view/app/category/category-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Categories
3 | 7 |
-------------------------------------------------------------------------------- /chapter_7/3.ecommerce-product-view/app/category/category-slide.component.html: -------------------------------------------------------------------------------- 1 | {{category.title}} 2 | -------------------------------------------------------------------------------- /chapter_7/3.ecommerce-product-view/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Contact Info
5 | 0000 Market St, Suite 000, San Francisco, CA 00000, (123) 456-7890, support@dream-bean.com 6 |
7 |
8 |
-------------------------------------------------------------------------------- /chapter_7/3.ecommerce-product-view/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Components 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-footer', 8 | templateUrl: 'app/footer/footer.component.html' 9 | }) 10 | export class FooterComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_7/3.ecommerce-product-view/app/main.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 5 | 6 | import { AppModule } from './app.module'; 7 | 8 | const platform = platformBrowserDynamic(); 9 | 10 | platform.bootstrapModule(AppModule); 11 | -------------------------------------------------------------------------------- /chapter_7/3.ecommerce-product-view/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import { Component } from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-navbar', 8 | templateUrl: 'app/navbar/navbar.component.html' 9 | }) 10 | export class NavbarComponent { } 11 | -------------------------------------------------------------------------------- /chapter_7/3.ecommerce-product-view/app/product/product-grid.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_7/3.ecommerce-product-view/app/product/product-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 |
10 |
11 |
-------------------------------------------------------------------------------- /chapter_7/3.ecommerce-product-view/app/product/product-list.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | 10 | @Component({ 11 | selector: 'db-products', 12 | templateUrl: 'app/product/product-list.component.html' 13 | }) 14 | export class ProductListComponent {} 15 | -------------------------------------------------------------------------------- /chapter_7/3.ecommerce-product-view/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_7/3.ecommerce-product-view/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_7/4.ecommerce-cart-view/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /chapter_7/4.ecommerce-cart-view/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'my-app', 8 | templateUrl: 'app/app.component.html' 9 | }) 10 | export class AppComponent {} 11 | -------------------------------------------------------------------------------- /chapter_7/4.ecommerce-cart-view/app/cart/cart-menu.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Cart, CartService} from './cart.service'; 10 | 11 | @Component({ 12 | selector: 'db-cart-menu', 13 | templateUrl: 'app/cart/cart-menu.component.html' 14 | }) 15 | export class CartMenuComponent { 16 | 17 | private cart: Cart; 18 | 19 | constructor(private cartService: CartService) { 20 | this.cart = this.cartService.cart; 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /chapter_7/4.ecommerce-cart-view/app/category/category-card.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{category.title}} 4 |
5 |

{{category.title}}

6 |

{{category.desc}}

7 | 8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /chapter_7/4.ecommerce-cart-view/app/category/category-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Categories
3 | 7 |
-------------------------------------------------------------------------------- /chapter_7/4.ecommerce-cart-view/app/category/category-slide.component.html: -------------------------------------------------------------------------------- 1 | {{category.title}} 2 | -------------------------------------------------------------------------------- /chapter_7/4.ecommerce-cart-view/app/category/category-slide.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input, Output, EventEmitter} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Category} from './category.service'; 10 | 11 | @Component({ 12 | selector: 'db-category-slide', 13 | templateUrl: 'app/category/category-slide.component.html' 14 | }) 15 | export class CategorySlideComponent { 16 | @Input() category: Category; 17 | @Output() select: EventEmitter = new EventEmitter(); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter_7/4.ecommerce-cart-view/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Contact Info
5 | 0000 Market St, Suite 000, San Francisco, CA 00000, (123) 456-7890, support@dream-bean.com 6 |
7 |
8 |
-------------------------------------------------------------------------------- /chapter_7/4.ecommerce-cart-view/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Components 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-footer', 8 | templateUrl: 'app/footer/footer.component.html' 9 | }) 10 | export class FooterComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_7/4.ecommerce-cart-view/app/main.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 5 | 6 | import { AppModule } from './app.module'; 7 | 8 | const platform = platformBrowserDynamic(); 9 | 10 | platform.bootstrapModule(AppModule); 11 | 12 | -------------------------------------------------------------------------------- /chapter_7/4.ecommerce-cart-view/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import { Component } from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-navbar', 8 | templateUrl: 'app/navbar/navbar.component.html' 9 | }) 10 | export class NavbarComponent { } 11 | -------------------------------------------------------------------------------- /chapter_7/4.ecommerce-cart-view/app/product/product-grid.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_7/4.ecommerce-cart-view/app/product/product-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 |
10 |
11 |
-------------------------------------------------------------------------------- /chapter_7/4.ecommerce-cart-view/app/product/product-list.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | 10 | @Component({ 11 | selector: 'db-products', 12 | templateUrl: 'app/product/product-list.component.html', 13 | }) 14 | export class ProductListComponent {} 15 | -------------------------------------------------------------------------------- /chapter_7/4.ecommerce-cart-view/app/product/product-search.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Quick Shop
3 |
4 | 6 | 7 | 10 | 11 |
12 |
-------------------------------------------------------------------------------- /chapter_7/4.ecommerce-cart-view/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_7/4.ecommerce-cart-view/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_7/5.ecommerce-checkout-view/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /chapter_7/5.ecommerce-checkout-view/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'my-app', 8 | templateUrl: 'app/app.component.html' 9 | }) 10 | export class AppComponent {} 11 | -------------------------------------------------------------------------------- /chapter_7/5.ecommerce-checkout-view/app/cart/cart-menu.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Cart, CartService} from './cart.service'; 10 | 11 | @Component({ 12 | selector: 'db-cart-menu', 13 | templateUrl: 'app/cart/cart-menu.component.html' 14 | }) 15 | export class CartMenuComponent { 16 | 17 | private cart: Cart; 18 | 19 | constructor(private cartService: CartService) { 20 | this.cart = this.cartService.cart; 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /chapter_7/5.ecommerce-checkout-view/app/category/category-card.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{category.title}} 4 |
5 |

{{category.title}}

6 |

{{category.desc}}

7 | 8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /chapter_7/5.ecommerce-checkout-view/app/category/category-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Categories
3 | 7 |
-------------------------------------------------------------------------------- /chapter_7/5.ecommerce-checkout-view/app/category/category-slide.component.html: -------------------------------------------------------------------------------- 1 | {{category.title}} 2 | -------------------------------------------------------------------------------- /chapter_7/5.ecommerce-checkout-view/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Contact Info
5 | 0000 Market St, Suite 000, San Francisco, CA 00000, (123) 456-7890, support@dream-bean.com 6 |
7 |
8 |
-------------------------------------------------------------------------------- /chapter_7/5.ecommerce-checkout-view/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Components 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-footer', 8 | templateUrl: 'app/footer/footer.component.html' 9 | }) 10 | export class FooterComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_7/5.ecommerce-checkout-view/app/main.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 5 | 6 | import { AppModule } from './app.module'; 7 | 8 | const platform = platformBrowserDynamic(); 9 | 10 | platform.bootstrapModule(AppModule); 11 | 12 | -------------------------------------------------------------------------------- /chapter_7/5.ecommerce-checkout-view/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import { Component } from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-navbar', 8 | templateUrl: 'app/navbar/navbar.component.html' 9 | }) 10 | export class NavbarComponent { } 11 | -------------------------------------------------------------------------------- /chapter_7/5.ecommerce-checkout-view/app/product/product-grid.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_7/5.ecommerce-checkout-view/app/product/product-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 |
10 |
11 |
-------------------------------------------------------------------------------- /chapter_7/5.ecommerce-checkout-view/app/product/product-list.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | 10 | @Component({ 11 | selector: 'db-products', 12 | templateUrl: 'app/product/product-list.component.html' 13 | }) 14 | export class ProductListComponent {} 15 | -------------------------------------------------------------------------------- /chapter_7/5.ecommerce-checkout-view/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_7/5.ecommerce-checkout-view/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_8/1.view-encapsulation/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'my-app', 5 | template: ` 6 | 7 | 8 | 9 | ` 10 | }) 11 | export class AppComponent { } -------------------------------------------------------------------------------- /chapter_8/1.view-encapsulation/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | 4 | import {AppComponent} from './app.component'; 5 | import {ParentComponent} from './parent.component'; 6 | import {ChildComponent} from './child.component'; 7 | 8 | @NgModule({ 9 | imports: [BrowserModule], 10 | declarations: [AppComponent, ParentComponent, ChildComponent], 11 | bootstrap: [AppComponent] 12 | }) 13 | export class AppModule { } -------------------------------------------------------------------------------- /chapter_8/1.view-encapsulation/app/child.component.ts: -------------------------------------------------------------------------------- 1 | import {Component} from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'my-child', 5 | template: ` 6 |
7 | Child 8 |
`, 9 | styles: [` 10 | .child { 11 | background: red; 12 | color: yellow; 13 | } 14 | `] 15 | }) 16 | export class ChildComponent { } -------------------------------------------------------------------------------- /chapter_8/1.view-encapsulation/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import {AppModule} from './app.module'; 4 | 5 | platformBrowserDynamic().bootstrapModule(AppModule); 6 | -------------------------------------------------------------------------------- /chapter_8/1.view-encapsulation/styles.css: -------------------------------------------------------------------------------- 1 | /* Master Styles */ 2 | body { 3 | margin: 2em; 4 | } 5 | -------------------------------------------------------------------------------- /chapter_8/1.view-encapsulation/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_8/1.view-encapsulation/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_8/2.after-content/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'my-app', 5 | template: ` 6 | 7 | 8 | ` 9 | }) 10 | export class AppComponent { } -------------------------------------------------------------------------------- /chapter_8/2.after-content/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | 4 | import {AppComponent} from './app.component'; 5 | import {ParentComponent} from './parent.component'; 6 | import {ChildComponent} from './child.component'; 7 | 8 | @NgModule({ 9 | imports: [BrowserModule], 10 | declarations: [AppComponent, ParentComponent, ChildComponent], 11 | bootstrap: [AppComponent] 12 | }) 13 | export class AppModule { } -------------------------------------------------------------------------------- /chapter_8/2.after-content/app/child.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, Input} from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'my-child', 5 | template: ` 6 |
7 | Child is {{status}} 8 |
`, 9 | styles: [` 10 | .child { 11 | background: red; 12 | color: yellow; 13 | } 14 | `] 15 | }) 16 | export class ChildComponent { 17 | @Input() status: string = 'Not Ready'; 18 | } -------------------------------------------------------------------------------- /chapter_8/2.after-content/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import {AppModule} from './app.module'; 4 | 5 | platformBrowserDynamic().bootstrapModule(AppModule); 6 | -------------------------------------------------------------------------------- /chapter_8/2.after-content/styles.css: -------------------------------------------------------------------------------- 1 | /* Master Styles */ 2 | body { 3 | margin: 2em; 4 | } 5 | -------------------------------------------------------------------------------- /chapter_8/2.after-content/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_8/2.after-content/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_8/3.after-view/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'my-app', 5 | template: ` 6 | 7 | ` 8 | }) 9 | export class AppComponent { } -------------------------------------------------------------------------------- /chapter_8/3.after-view/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | 4 | import {AppComponent} from './app.component'; 5 | import {ParentComponent} from './parent.component'; 6 | import {ChildComponent} from './child.component'; 7 | 8 | @NgModule({ 9 | imports: [BrowserModule], 10 | declarations: [AppComponent, ParentComponent, ChildComponent], 11 | bootstrap: [AppComponent] 12 | }) 13 | export class AppModule { } -------------------------------------------------------------------------------- /chapter_8/3.after-view/app/child.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, Input} from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'my-child', 5 | template: ` 6 |
7 | Child is {{status}} 8 |
`, 9 | styles: [` 10 | .child { 11 | background: red; 12 | color: yellow; 13 | } 14 | `] 15 | }) 16 | export class ChildComponent { 17 | @Input() status: string = 'Not Ready'; 18 | } -------------------------------------------------------------------------------- /chapter_8/3.after-view/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import {AppModule} from './app.module'; 4 | 5 | platformBrowserDynamic().bootstrapModule(AppModule); 6 | -------------------------------------------------------------------------------- /chapter_8/3.after-view/styles.css: -------------------------------------------------------------------------------- 1 | /* Master Styles */ 2 | body { 3 | margin: 2em; 4 | } 5 | -------------------------------------------------------------------------------- /chapter_8/3.after-view/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_8/3.after-view/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_8/4.parent-child-input-binding/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'my-app', 5 | template: ` 6 | 7 | ` 8 | }) 9 | export class AppComponent { } -------------------------------------------------------------------------------- /chapter_8/4.parent-child-input-binding/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | 4 | import {AppComponent} from './app.component'; 5 | import {ParentComponent} from './parent.component'; 6 | import {ChildComponent} from './child.component'; 7 | 8 | @NgModule({ 9 | imports: [BrowserModule], 10 | declarations: [AppComponent, ParentComponent, ChildComponent], 11 | bootstrap: [AppComponent] 12 | }) 13 | export class AppModule { } -------------------------------------------------------------------------------- /chapter_8/4.parent-child-input-binding/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import {AppModule} from './app.module'; 4 | 5 | platformBrowserDynamic().bootstrapModule(AppModule); 6 | -------------------------------------------------------------------------------- /chapter_8/4.parent-child-input-binding/styles.css: -------------------------------------------------------------------------------- 1 | /* Master Styles */ 2 | body { 3 | margin: 2em; 4 | } 5 | -------------------------------------------------------------------------------- /chapter_8/4.parent-child-input-binding/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_8/4.parent-child-input-binding/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_8/5.parent-child-local-variable/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'my-app', 5 | template: ` 6 | 7 | ` 8 | }) 9 | export class AppComponent { } -------------------------------------------------------------------------------- /chapter_8/5.parent-child-local-variable/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | 4 | import {AppComponent} from './app.component'; 5 | import {ParentComponent} from './parent.component'; 6 | import {ChildComponent} from './child.component'; 7 | import {NgInit} from './ng-init.directive'; 8 | 9 | @NgModule({ 10 | imports: [BrowserModule], 11 | declarations: [AppComponent, ParentComponent, ChildComponent, NgInit], 12 | bootstrap: [AppComponent] 13 | }) 14 | export class AppModule { } -------------------------------------------------------------------------------- /chapter_8/5.parent-child-local-variable/app/child.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, Input} from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'my-child', 5 | template: ` 6 |
7 | {{desc}} 8 |
`, 9 | styles: [` 10 | .child { 11 | background: red; 12 | color: yellow; 13 | } 14 | `] 15 | }) 16 | export class ChildComponent { 17 | @Input() desc: string; 18 | 19 | setDesc(value: string) { 20 | this.desc = value; 21 | } 22 | } -------------------------------------------------------------------------------- /chapter_8/5.parent-child-local-variable/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import {AppModule} from './app.module'; 4 | 5 | platformBrowserDynamic().bootstrapModule(AppModule); 6 | -------------------------------------------------------------------------------- /chapter_8/5.parent-child-local-variable/app/ng-init.directive.ts: -------------------------------------------------------------------------------- 1 | import {Directive, Input} from '@angular/core'; 2 | 3 | @Directive({ 4 | selector: '[ngInit]' 5 | }) 6 | export class NgInit { 7 | @Input() ngInit; 8 | 9 | ngOnInit() { 10 | if(this.ngInit) { 11 | this.ngInit(); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /chapter_8/5.parent-child-local-variable/styles.css: -------------------------------------------------------------------------------- 1 | /* Master Styles */ 2 | body { 3 | margin: 2em; 4 | } 5 | -------------------------------------------------------------------------------- /chapter_8/5.parent-child-local-variable/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_8/5.parent-child-local-variable/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_8/6.parent-child-viewchild/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'my-app', 5 | template: ` 6 | 7 | ` 8 | }) 9 | export class AppComponent { } -------------------------------------------------------------------------------- /chapter_8/6.parent-child-viewchild/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | 4 | import {AppComponent} from './app.component'; 5 | import {ParentComponent} from './parent.component'; 6 | import {ChildComponent} from './child.component'; 7 | 8 | @NgModule({ 9 | imports: [BrowserModule], 10 | declarations: [AppComponent, ParentComponent, ChildComponent], 11 | bootstrap: [AppComponent] 12 | }) 13 | export class AppModule { } -------------------------------------------------------------------------------- /chapter_8/6.parent-child-viewchild/app/child.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, Input, OnInit} from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'my-child', 5 | template: ` 6 |
7 | {{desc}} 8 |
`, 9 | styles: [` 10 | .child { 11 | background: red; 12 | color: yellow; 13 | } 14 | `] 15 | }) 16 | export class ChildComponent implements OnInit { 17 | @Input() desc: string = "You are mine"; 18 | 19 | ngOnInit(): void { 20 | this.desc = "You are checked"; 21 | } 22 | } -------------------------------------------------------------------------------- /chapter_8/6.parent-child-viewchild/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import {AppModule} from './app.module'; 4 | 5 | platformBrowserDynamic().bootstrapModule(AppModule); 6 | -------------------------------------------------------------------------------- /chapter_8/6.parent-child-viewchild/styles.css: -------------------------------------------------------------------------------- 1 | /* Master Styles */ 2 | body { 3 | margin: 2em; 4 | } 5 | -------------------------------------------------------------------------------- /chapter_8/6.parent-child-viewchild/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_8/6.parent-child-viewchild/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_8/7.parent-child-service/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'my-app', 5 | template: ` 6 | 7 | ` 8 | }) 9 | export class AppComponent { } -------------------------------------------------------------------------------- /chapter_8/7.parent-child-service/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | 4 | import {AppComponent} from './app.component'; 5 | import {ParentComponent} from './parent.component'; 6 | import {ChildComponent} from './child.component'; 7 | 8 | @NgModule({ 9 | imports: [BrowserModule], 10 | declarations: [AppComponent, ParentComponent, ChildComponent], 11 | bootstrap: [AppComponent] 12 | }) 13 | export class AppModule { } -------------------------------------------------------------------------------- /chapter_8/7.parent-child-service/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import {AppModule} from './app.module'; 4 | 5 | platformBrowserDynamic().bootstrapModule(AppModule); 6 | -------------------------------------------------------------------------------- /chapter_8/7.parent-child-service/styles.css: -------------------------------------------------------------------------------- 1 | /* Master Styles */ 2 | body { 3 | margin: 2em; 4 | } 5 | -------------------------------------------------------------------------------- /chapter_8/7.parent-child-service/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chapter_8/7.parent-child-service/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160725163759", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160909174046" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-firebase/.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "ecommerce-a99fc" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-firebase/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-firebase/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'my-app', 8 | templateUrl: 'app/app.component.html', 9 | }) 10 | export class AppComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-firebase/app/cart/cart-item-count.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-firebase/app/cart/cart-menu.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Cart, CartService} from './cart.service'; 10 | 11 | @Component({ 12 | selector: 'db-cart-menu', 13 | templateUrl: 'app/cart/cart-menu.component.html' 14 | }) 15 | export class CartMenuComponent { 16 | 17 | private cart: Cart; 18 | 19 | constructor(private cartService: CartService) { 20 | this.cart = this.cartService.cart; 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-firebase/app/category/category-card.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{category.title}} 4 |
5 |

{{category.title}}

6 |

{{category.desc}}

7 | 8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-firebase/app/category/category-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Categories
3 | 7 |
-------------------------------------------------------------------------------- /chapter_9/ecommerce-firebase/app/category/category-slide.component.html: -------------------------------------------------------------------------------- 1 | {{category.title}} 2 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-firebase/app/category/category-slide.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input, Output, EventEmitter} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Category} from './category.service'; 10 | 11 | @Component({ 12 | selector: 'db-category-slide', 13 | templateUrl: 'app/category/category-slide.component.html' 14 | }) 15 | export class CategorySlideComponent { 16 | @Input() category: Category; 17 | @Output() select: EventEmitter = new EventEmitter(); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-firebase/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Contact Info
5 | 0000 Market St, Suite 000, San Francisco, CA 00000, (123) 456-7890, support@dream-bean.com 6 |
7 |
8 |
-------------------------------------------------------------------------------- /chapter_9/ecommerce-firebase/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Components 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-footer', 8 | templateUrl: 'app/footer/footer.component.html' 9 | }) 10 | export class FooterComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-firebase/app/main.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; 5 | 6 | /* 7 | * The app module 8 | */ 9 | import {AppModule} from './app.module'; 10 | 11 | /* 12 | * Bootstrap out application 13 | */ 14 | platformBrowserDynamic().bootstrapModule(AppModule); 15 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-firebase/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import { Component } from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-navbar', 8 | templateUrl: 'app/navbar/navbar.component.html' 9 | }) 10 | export class NavbarComponent { } 11 | 12 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-firebase/app/product/product-grid.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-firebase/app/product/product-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 |
10 |
11 |
-------------------------------------------------------------------------------- /chapter_9/ecommerce-firebase/app/product/product-list.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-products', 8 | templateUrl: 'app/product/product-list.component.html' 9 | }) 10 | export class ProductListComponent {} 11 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-firebase/app/product/product-search.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Quick Shop
3 | 5 |
-------------------------------------------------------------------------------- /chapter_9/ecommerce-firebase/app/product/product-search.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | import {Router} from '@angular/router'; 6 | 7 | @Component({ 8 | selector: 'db-product-search', 9 | templateUrl: 'app/product/product-search.component.html' 10 | }) 11 | export class ProductSearchComponent { 12 | 13 | constructor(private router: Router) {} 14 | 15 | searchProduct(value: string) { 16 | this.router.navigate(['/products'], { queryParams: { search: value} }); 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-firebase/database.rules.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | ".read": true, 4 | ".write": "auth != null", 5 | "products": { 6 | ".indexOn": ["categoryId", "title"] 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /chapter_9/ecommerce-firebase/firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "database": { 3 | "rules": "database.rules.json" 4 | }, 5 | "hosting": { 6 | "public": ".", 7 | "rewrites": [ 8 | { 9 | "source": "**", 10 | "destination": "/index.html" 11 | } 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-firebase/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } -------------------------------------------------------------------------------- /chapter_9/ecommerce-firebase/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160602141332", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160807145350" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-observable/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-observable/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'my-app', 8 | templateUrl: 'app/app.component.html', 9 | }) 10 | export class AppComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-observable/app/cart/cart-item-count.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-observable/app/cart/cart-menu.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Cart, CartService} from './cart.service'; 10 | 11 | @Component({ 12 | selector: 'db-cart-menu', 13 | templateUrl: 'app/cart/cart-menu.component.html' 14 | }) 15 | export class CartMenuComponent { 16 | 17 | private cart: Cart; 18 | 19 | constructor(private cartService: CartService) { 20 | this.cart = this.cartService.cart; 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-observable/app/category/category-card.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{category.title}} 4 |
5 |

{{category.title}}

6 |

{{category.desc}}

7 | 8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-observable/app/category/category-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Categories
3 | 7 |
-------------------------------------------------------------------------------- /chapter_9/ecommerce-observable/app/category/category-slide.component.html: -------------------------------------------------------------------------------- 1 | {{category.title}} 2 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-observable/app/category/category-slide.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input, Output, EventEmitter} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Category} from './category.service'; 10 | 11 | @Component({ 12 | selector: 'db-category-slide', 13 | templateUrl: 'app/category/category-slide.component.html' 14 | }) 15 | export class CategorySlideComponent { 16 | @Input() category: Category; 17 | @Output() select: EventEmitter = new EventEmitter(); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-observable/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Contact Info
5 | 0000 Market St, Suite 000, San Francisco, CA 00000, (123) 456-7890, support@dream-bean.com 6 |
7 |
8 |
-------------------------------------------------------------------------------- /chapter_9/ecommerce-observable/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Components 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-footer', 8 | templateUrl: 'app/footer/footer.component.html' 9 | }) 10 | export class FooterComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-observable/app/main.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; 5 | 6 | /* 7 | * The app module 8 | */ 9 | import {AppModule} from './app.module'; 10 | 11 | /* 12 | * Bootstrap out application 13 | */ 14 | platformBrowserDynamic().bootstrapModule(AppModule); 15 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-observable/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import { Component } from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-navbar', 8 | templateUrl: 'app/navbar/navbar.component.html' 9 | }) 10 | export class NavbarComponent { } 11 | 12 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-observable/app/product/product-grid.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-observable/app/product/product-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 |
10 |
11 |
-------------------------------------------------------------------------------- /chapter_9/ecommerce-observable/app/product/product-list.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-products', 8 | templateUrl: 'app/product/product-list.component.html' 9 | }) 10 | export class ProductListComponent {} 11 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-observable/app/product/product-search.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Quick Shop
3 | 5 |
-------------------------------------------------------------------------------- /chapter_9/ecommerce-observable/app/product/product-search.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | import {Router} from '@angular/router'; 6 | 7 | @Component({ 8 | selector: 'db-product-search', 9 | templateUrl: 'app/product/product-search.component.html' 10 | }) 11 | export class ProductSearchComponent { 12 | 13 | constructor(private router: Router) {} 14 | 15 | searchProduct(value: string) { 16 | this.router.navigate(['/products'], { queryParams: { search: value} }); 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-observable/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } -------------------------------------------------------------------------------- /chapter_9/ecommerce-observable/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160602141332", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160807145350" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-promise/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-promise/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'my-app', 8 | templateUrl: 'app/app.component.html', 9 | }) 10 | export class AppComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-promise/app/cart/cart-item-count.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-promise/app/cart/cart-menu.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Cart, CartService} from './cart.service'; 10 | 11 | @Component({ 12 | selector: 'db-cart-menu', 13 | templateUrl: 'app/cart/cart-menu.component.html' 14 | }) 15 | export class CartMenuComponent { 16 | 17 | private cart: Cart; 18 | 19 | constructor(private cartService: CartService) { 20 | this.cart = this.cartService.cart; 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-promise/app/category/category-card.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{category.title}} 4 |
5 |

{{category.title}}

6 |

{{category.desc}}

7 | 8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-promise/app/category/category-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Categories
3 | 7 |
-------------------------------------------------------------------------------- /chapter_9/ecommerce-promise/app/category/category-slide.component.html: -------------------------------------------------------------------------------- 1 | {{category.title}} 2 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-promise/app/category/category-slide.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component, Input, Output, EventEmitter} from '@angular/core'; 5 | 6 | /* 7 | * Components 8 | */ 9 | import {Category} from './category.service'; 10 | 11 | @Component({ 12 | selector: 'db-category-slide', 13 | templateUrl: 'app/category/category-slide.component.html' 14 | }) 15 | export class CategorySlideComponent { 16 | @Input() category: Category; 17 | @Output() select: EventEmitter = new EventEmitter(); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-promise/app/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Contact Info
5 | 0000 Market St, Suite 000, San Francisco, CA 00000, (123) 456-7890, support@dream-bean.com 6 |
7 |
8 |
-------------------------------------------------------------------------------- /chapter_9/ecommerce-promise/app/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Components 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-footer', 8 | templateUrl: 'app/footer/footer.component.html' 9 | }) 10 | export class FooterComponent { 11 | } 12 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-promise/app/main.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; 5 | 6 | /* 7 | * The app module 8 | */ 9 | import {AppModule} from './app.module'; 10 | 11 | /* 12 | * Bootstrap out application 13 | */ 14 | platformBrowserDynamic().bootstrapModule(AppModule); 15 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-promise/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import { Component } from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-navbar', 8 | templateUrl: 'app/navbar/navbar.component.html' 9 | }) 10 | export class NavbarComponent { } 11 | 12 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-promise/app/product/product-grid.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-promise/app/product/product-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 |
10 |
11 |
-------------------------------------------------------------------------------- /chapter_9/ecommerce-promise/app/product/product-list.component.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Angular Imports 3 | */ 4 | import {Component} from '@angular/core'; 5 | 6 | @Component({ 7 | selector: 'db-products', 8 | templateUrl: 'app/product/product-list.component.html' 9 | }) 10 | export class ProductListComponent {} 11 | -------------------------------------------------------------------------------- /chapter_9/ecommerce-promise/app/product/product-search.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Quick Shop
3 |
4 | 6 | 7 | 10 | 11 |
12 |
-------------------------------------------------------------------------------- /chapter_9/ecommerce-promise/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | } 12 | } -------------------------------------------------------------------------------- /chapter_9/ecommerce-promise/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160602141332", 4 | "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 5 | "node": "registry:dt/node#6.0.0+20160807145350" 6 | } 7 | } 8 | --------------------------------------------------------------------------------