├── .editorconfig ├── .gitignore ├── .vscode └── settings.json ├── INSTALL.md ├── README.md ├── angular.json ├── browserslist ├── e2e ├── protractor.conf.js ├── src │ ├── app.e2e-spec.ts │ └── app.po.ts └── tsconfig.json ├── karma.conf.js ├── package-lock.json ├── package.json ├── src ├── app │ ├── admin │ │ ├── admin-routing.module.ts │ │ ├── admin.module.ts │ │ └── components │ │ │ ├── dashboard │ │ │ ├── dashboard.component.html │ │ │ ├── dashboard.component.scss │ │ │ ├── dashboard.component.spec.ts │ │ │ └── dashboard.component.ts │ │ │ ├── form-product │ │ │ ├── form-product.component.html │ │ │ ├── form-product.component.scss │ │ │ ├── form-product.component.spec.ts │ │ │ └── form-product.component.ts │ │ │ ├── list-products │ │ │ ├── list-products-datasource.ts │ │ │ ├── list-products.component.html │ │ │ ├── list-products.component.scss │ │ │ ├── list-products.component.spec.ts │ │ │ └── list-products.component.ts │ │ │ ├── nav │ │ │ ├── nav.component.html │ │ │ ├── nav.component.scss │ │ │ ├── nav.component.spec.ts │ │ │ └── nav.component.ts │ │ │ ├── product-edit │ │ │ ├── product-edit.component.html │ │ │ ├── product-edit.component.scss │ │ │ ├── product-edit.component.spec.ts │ │ │ └── product-edit.component.ts │ │ │ ├── product-form │ │ │ ├── product-form.component.html │ │ │ ├── product-form.component.scss │ │ │ ├── product-form.component.spec.ts │ │ │ └── product-form.component.ts │ │ │ └── products-list │ │ │ ├── products-list.component.html │ │ │ ├── products-list.component.scss │ │ │ ├── products-list.component.spec.ts │ │ │ └── products-list.component.ts │ ├── app-routing.module.ts │ ├── app.component.scss │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.module.ts │ ├── components │ │ ├── cart │ │ │ ├── cart.component.html │ │ │ ├── cart.component.scss │ │ │ ├── cart.component.spec.ts │ │ │ └── cart.component.ts │ │ └── not-found │ │ │ ├── not-found.component.html │ │ │ ├── not-found.component.scss │ │ │ ├── not-found.component.spec.ts │ │ │ └── not-found.component.ts │ ├── contact │ │ ├── components │ │ │ ├── contact.component.html │ │ │ ├── contact.component.scss │ │ │ ├── contact.component.spec.ts │ │ │ └── contact.component.ts │ │ ├── contact-routing.module.ts │ │ └── contact.module.ts │ ├── core │ │ ├── core.module.ts │ │ └── services │ │ │ ├── cart.service.spec.ts │ │ │ ├── cart.service.ts │ │ │ └── products │ │ │ ├── products.service.spec.ts │ │ │ └── products.service.ts │ ├── guardians │ │ ├── admin.guard.spec.ts │ │ └── admin.guard.ts │ ├── home │ │ ├── components │ │ │ ├── banner │ │ │ │ ├── banner.component.html │ │ │ │ ├── banner.component.scss │ │ │ │ ├── banner.component.spec.ts │ │ │ │ └── banner.component.ts │ │ │ └── home │ │ │ │ ├── home.component.html │ │ │ │ ├── home.component.scss │ │ │ │ ├── home.component.spec.ts │ │ │ │ └── home.component.ts │ │ ├── home-routing.module.ts │ │ └── home.module.ts │ ├── layout │ │ ├── layout.component.html │ │ ├── layout.component.scss │ │ ├── layout.component.spec.ts │ │ └── layout.component.ts │ ├── material │ │ └── material.module.ts │ ├── order │ │ ├── components │ │ │ └── order │ │ │ │ ├── order.component.html │ │ │ │ ├── order.component.scss │ │ │ │ ├── order.component.spec.ts │ │ │ │ └── order.component.ts │ │ ├── order-routing.module.ts │ │ └── order.module.ts │ ├── product.model.ts │ ├── products │ │ ├── components │ │ │ ├── product-detail │ │ │ │ ├── product-detail.component.html │ │ │ │ ├── product-detail.component.scss │ │ │ │ ├── product-detail.component.spec.ts │ │ │ │ └── product-detail.component.ts │ │ │ ├── product │ │ │ │ ├── product.component.html │ │ │ │ ├── product.component.scss │ │ │ │ └── product.component.ts │ │ │ └── products │ │ │ │ ├── products.component.html │ │ │ │ ├── products.component.scss │ │ │ │ ├── products.component.spec.ts │ │ │ │ └── products.component.ts │ │ ├── product-routing.module.ts │ │ └── products.module.ts │ ├── shared │ │ ├── cart │ │ │ ├── cart.component.html │ │ │ ├── cart.component.scss │ │ │ ├── cart.component.spec.ts │ │ │ └── cart.component.ts │ │ ├── components │ │ │ ├── footer │ │ │ │ ├── footer.component.html │ │ │ │ ├── footer.component.scss │ │ │ │ ├── footer.component.spec.ts │ │ │ │ └── footer.component.ts │ │ │ └── header │ │ │ │ ├── header.component.html │ │ │ │ ├── header.component.scss │ │ │ │ ├── header.component.spec.ts │ │ │ │ └── header.component.ts │ │ ├── directives │ │ │ └── highlight │ │ │ │ ├── highlight.directive.spec.ts │ │ │ │ └── highlight.directive.ts │ │ ├── pipes │ │ │ └── exponential │ │ │ │ ├── exponential.pipe.spec.ts │ │ │ │ └── exponential.pipe.ts │ │ └── shared.module.ts │ ├── test │ │ ├── test.component.html │ │ ├── test.component.scss │ │ ├── test.component.spec.ts │ │ └── test.component.ts │ └── utils │ │ └── validators.ts ├── assets │ ├── .gitkeep │ └── images │ │ ├── banner-1.jpg │ │ ├── banner-2.jpg │ │ ├── banner-3.jpg │ │ ├── camiseta.png │ │ ├── hoodie.png │ │ ├── mug.png │ │ ├── pin.png │ │ ├── stickers1.png │ │ └── stickers2.png ├── environments │ ├── environment.prod.ts │ ├── environment.stag.ts │ └── environment.ts ├── favicon.ico ├── index.html ├── main.ts ├── polyfills.ts ├── styles.scss └── test.ts ├── tsconfig.app.json ├── tsconfig.json ├── tsconfig.spec.json └── tslint.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | # Only exists if Bazel was run 8 | /bazel-out 9 | 10 | # dependencies 11 | /node_modules 12 | 13 | # profiling files 14 | chrome-profiler-events*.json 15 | speed-measure-plugin*.json 16 | 17 | # IDEs and editors 18 | /.idea 19 | .project 20 | .classpath 21 | .c9/ 22 | *.launch 23 | .settings/ 24 | *.sublime-workspace 25 | 26 | # IDE - VSCode 27 | .vscode/* 28 | !.vscode/settings.json 29 | !.vscode/tasks.json 30 | !.vscode/launch.json 31 | !.vscode/extensions.json 32 | .history/* 33 | 34 | # misc 35 | /.sass-cache 36 | /connect.lock 37 | /coverage 38 | /libpeerconnection.log 39 | npm-debug.log 40 | yarn-error.log 41 | testem.log 42 | /typings 43 | 44 | # System Files 45 | .DS_Store 46 | Thumbs.db 47 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.words": [ 3 | "Swiper", 4 | "flexboxgrid", 5 | "sidenav" 6 | ] 7 | } -------------------------------------------------------------------------------- /INSTALL.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # PlatziStore 4 | 5 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.0. 6 | 7 | ## Development server 8 | 9 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 10 | 11 | ## Code scaffolding 12 | 13 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 14 | 15 | ## Build 16 | 17 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 18 | 19 | ## Running unit tests 20 | 21 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 22 | 23 | ## Running end-to-end tests 24 | 25 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 26 | 27 | ## Further help 28 | 29 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Angular 2 | 3 | # Comandos bash 4 | 5 | ## `ng serve` -> 6 | 7 | para levantar el servidor (puedes enviarle mas datos como puerto o dominio donde quieres que corra, normalmente usa el puerto 4200) 8 | 9 | Para cambiar la ruta en la cual correrá el proyecto: 10 | 11 | ```bash 12 | ng serve --o --host 192.168.1.26 --port {PORT} // cambiar la ruta en la cual correrá el proyecto 13 | ``` 14 | 15 | ## `ng build --prod` -> 16 | 17 | similar a serve, se usa para alistar la aplicación para producción, te genera una capeta en tu proyecto llamada “dist” donde crea lo necesario para montar en producción. 18 | 19 | ## `ng --version` -> 20 | 21 | Versiones que tienes en tu proyecto 22 | 23 | ## `ng g`-> 24 | 25 | Genera automáticamente el componente en una carpeta con el mismo nombre que se le dio. Ademas lo importa automáticamente en al *app.module.ts* 26 | 27 | ```shell 28 | ng g c components/cart 29 | ``` 30 | 31 | - g = generate 32 | - c = component 33 | 34 | ### Flags 35 | 36 | #### --inline-style 37 | 38 | Evita que se cree el archivo de estilos 39 | 40 | ```shell 41 | ng g c componente --inline-style 42 | ``` 43 | 44 | #### --inline-template 45 | 46 | Este evita que se cree el html 47 | 48 | ```shell 49 | ng g c componente --inline-template 50 | ``` 51 | 52 | ## `ng lint`-> 53 | 54 | ``` 55 | ng lint 56 | ``` 57 | 58 | Revisa el código del proyecto para ver si se están cumpliendo las reglas definidas en el archivo tslint.json 59 | 60 | ``` 61 | ng lint --format json 62 | ``` 63 | 64 | Nos permite visualizar el resultado de la revisión con un formato json. 65 | 66 | ``` 67 | ng lint --fix 68 | ``` 69 | 70 | Corrige automáticamente, dentro de lo posible, los errores encontrados. 71 | 72 | # [Directivas](https://angular.io/api/common#directives) 73 | 74 | ## `ngIf` 75 | 76 | Muestra el componente sólo si cumple con la directiva 77 | 78 | ```html 79 |
114 | Las suma de 2 + 2 = {{ 2 + 2 }} 115 |
116 | ``` 117 | 118 | Angular divide la lógica de la vista, pero puedes hacer uso de los elementos de uno o del otro en las 2 partes. 119 | 120 | ## `{{ template-expression }}` 121 | 122 | Un template expresion es la expresión que se va a evaluar para renderizarse en el DOM. 123 | 124 | Los tipos de **Template Expresion** válidos pueden ser: 125 | 126 | - **{{ `1 + 1` }}**: la cual devuelve 2 127 | - **{{ `miVariable` }}**: donde miVariable es una variable definida en el **Component** 128 | - **{{ `miMetodo()` }}** : donde miMetodo() es un método definido en el **Component** 129 | 130 | También se le puede asignar a un atributo **HTML** (que espere un string) el valor de una **Template Expresion**, por ejemplo 131 | 132 | `Id | 6 |{{row.id}} | 7 |Name | 12 |{{row.name}} | 13 |
---|
ID | 7 |{{product.id}} | 8 |title | 11 |{{product.title}} | 12 |price | 15 |{{product.price}} | 16 |actions | 19 |20 | 21 | 22 | | 23 |
---|
cart works!
2 | -------------------------------------------------------------------------------- /src/app/components/cart/cart.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/behagoras/angular-store/d42f63e7ad69178b6c24f8c128cd8e3ad45b7730/src/app/components/cart/cart.component.scss -------------------------------------------------------------------------------- /src/app/components/cart/cart.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CartComponent } from './cart.component'; 4 | 5 | describe('CartComponent', () => { 6 | let component: CartComponent; 7 | let fixture: ComponentFixtureLooks like the page you were looking for is no longer here.
9 |contact works!
2 | -------------------------------------------------------------------------------- /src/app/contact/components/contact.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/behagoras/angular-store/d42f63e7ad69178b6c24f8c128cd8e3ad45b7730/src/app/contact/components/contact.component.scss -------------------------------------------------------------------------------- /src/app/contact/components/contact.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ContactComponent } from './contact.component'; 4 | 5 | describe('ContactComponent', () => { 6 | let component: ContactComponent; 7 | let fixture: ComponentFixtureno hay productos
7 | 8 |{{product.description}}
11 |{{ product.description | slice:0:10 }}
15 |{{ today | date:'longDate'}}
16 |cart works!
2 | -------------------------------------------------------------------------------- /src/app/shared/cart/cart.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/behagoras/angular-store/d42f63e7ad69178b6c24f8c128cd8e3ad45b7730/src/app/shared/cart/cart.component.scss -------------------------------------------------------------------------------- /src/app/shared/cart/cart.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CartComponent } from './cart.component'; 4 | 5 | describe('CartComponent', () => { 6 | let component: CartComponent; 7 | let fixture: ComponentFixtureEste es david
10 |Este es nicolas
11 |Este es julian
12 |No hace match, intenta con 'david'
13 |34 | {{ "Hola Mundo " + 1 }} 35 |
36 | 37 | 38 | {{ power | exponential:3 }} 39 | -------------------------------------------------------------------------------- /src/app/test/test.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/behagoras/angular-store/d42f63e7ad69178b6c24f8c128cd8e3ad45b7730/src/app/test/test.component.scss -------------------------------------------------------------------------------- /src/app/test/test.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TestComponent } from './test.component'; 4 | 5 | describe('TestComponent', () => { 6 | let component: TestComponent; 7 | let fixture: ComponentFixture