├── .devcontainer ├── devcontainer.json └── postCreate.sh ├── .github └── workflows │ └── stale.yml ├── .gitignore ├── README.md ├── angular-cli-libs-externas ├── .editorconfig ├── .gitignore ├── README.md ├── angular.json ├── e2e │ ├── app.e2e-spec.ts │ ├── app.po.ts │ └── tsconfig.e2e.json ├── karma.conf.js ├── package.json ├── protractor.conf.js ├── src │ ├── app │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.ts │ │ └── app.module.ts │ ├── assets │ │ └── .gitkeep │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ ├── polyfills.ts │ ├── styles.css │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── typings.d.ts ├── tsconfig.json └── tslint.json ├── angularv61 ├── .angulardoc.json ├── .browserslistrc ├── .editorconfig ├── .gitignore ├── README.md ├── angular.json ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json ├── package.json ├── src │ ├── app │ │ ├── alunos │ │ │ ├── alunos.component.html │ │ │ └── alunos.component.ts │ │ ├── app-routing.module.ts │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── cursos │ │ │ ├── cursos.component.html │ │ │ └── cursos.component.ts │ │ └── key-value │ │ │ ├── key-value.component.html │ │ │ └── key-value.component.ts │ ├── assets │ │ └── .gitkeep │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── karma.conf.js │ ├── main.ts │ ├── polyfills.ts │ ├── styles.css │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── tslint.json ├── tsconfig.base.json ├── tsconfig.json └── tslint.json ├── crud-angular-spring ├── crud-angular │ ├── .editorconfig │ ├── .gitignore │ ├── .vscode │ │ └── settings.json │ ├── README.md │ ├── angular.json │ ├── karma.conf.js │ ├── package.json │ ├── proxy.conf.js │ ├── src │ │ ├── app │ │ │ ├── app.component.html │ │ │ ├── app.component.scss │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ ├── app.routes.ts │ │ │ ├── courses │ │ │ │ ├── components │ │ │ │ │ └── courses-list │ │ │ │ │ │ ├── courses-list.component.html │ │ │ │ │ │ ├── courses-list.component.scss │ │ │ │ │ │ ├── courses-list.component.spec.ts │ │ │ │ │ │ └── courses-list.component.ts │ │ │ │ ├── containers │ │ │ │ │ ├── course-form │ │ │ │ │ │ ├── course-form.component.html │ │ │ │ │ │ ├── course-form.component.scss │ │ │ │ │ │ ├── course-form.component.spec.ts │ │ │ │ │ │ └── course-form.component.ts │ │ │ │ │ └── courses │ │ │ │ │ │ ├── courses.component.html │ │ │ │ │ │ ├── courses.component.scss │ │ │ │ │ │ ├── courses.component.spec.ts │ │ │ │ │ │ └── courses.component.ts │ │ │ │ ├── courses.routes.ts │ │ │ │ ├── guards │ │ │ │ │ ├── course.resolver.spec.ts │ │ │ │ │ └── course.resolver.ts │ │ │ │ ├── model │ │ │ │ │ ├── course-page.ts │ │ │ │ │ ├── course.ts │ │ │ │ │ └── lesson.ts │ │ │ │ └── services │ │ │ │ │ ├── courses.service.spec.ts │ │ │ │ │ └── courses.service.ts │ │ │ └── shared │ │ │ │ ├── components │ │ │ │ ├── confirmation-dialog │ │ │ │ │ ├── confirmation-dialog.component.html │ │ │ │ │ ├── confirmation-dialog.component.scss │ │ │ │ │ ├── confirmation-dialog.component.spec.ts │ │ │ │ │ └── confirmation-dialog.component.ts │ │ │ │ └── error-dialog │ │ │ │ │ ├── error-dialog.component.html │ │ │ │ │ ├── error-dialog.component.scss │ │ │ │ │ ├── error-dialog.component.spec.ts │ │ │ │ │ └── error-dialog.component.ts │ │ │ │ ├── form │ │ │ │ ├── form-utils.service.spec.ts │ │ │ │ └── form-utils.service.ts │ │ │ │ └── pipes │ │ │ │ ├── category.pipe.spec.ts │ │ │ │ └── category.pipe.ts │ │ ├── assets │ │ │ ├── .gitkeep │ │ │ └── courses.json │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.scss │ │ └── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.json │ └── tsconfig.spec.json ├── crud-spring.zip └── crud-spring │ ├── .gitignore │ ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── api.http │ ├── compose.yaml │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── loiane │ │ │ ├── CrudSpringApplication.java │ │ │ ├── controller │ │ │ ├── ApplicationControllerAdvice.java │ │ │ └── CourseController.java │ │ │ ├── dto │ │ │ ├── CourseDTO.java │ │ │ ├── CoursePageDTO.java │ │ │ ├── LessonDTO.java │ │ │ └── mapper │ │ │ │ └── CourseMapper.java │ │ │ ├── enums │ │ │ ├── Category.java │ │ │ ├── Status.java │ │ │ ├── converters │ │ │ │ ├── CategoryConverter.java │ │ │ │ └── StatusConverter.java │ │ │ └── validation │ │ │ │ ├── ValueOfEnum.java │ │ │ │ └── ValueOfEnumValidator.java │ │ │ ├── exception │ │ │ └── RecordNotFoundException.java │ │ │ ├── model │ │ │ ├── Course.java │ │ │ └── Lesson.java │ │ │ ├── repository │ │ │ └── CourseRepository.java │ │ │ └── service │ │ │ └── CourseService.java │ └── resources │ │ ├── application-dev.properties │ │ ├── application-test.properties │ │ └── application.properties │ └── test │ └── java │ └── com │ └── loiane │ └── CrudSpringApplicationTests.java ├── data-binding ├── .browserslistrc ├── .editorconfig ├── .gitignore ├── README.md ├── angular.json ├── e2e │ ├── app.e2e-spec.ts │ ├── app.po.ts │ └── tsconfig.e2e.json ├── karma.conf.js ├── package-lock.json ├── package.json ├── protractor.conf.js ├── src │ ├── app │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── ciclo │ │ │ ├── ciclo.component.css │ │ │ ├── ciclo.component.html │ │ │ └── ciclo.component.ts │ │ ├── data-binding │ │ │ ├── data-binding.component.css │ │ │ ├── data-binding.component.html │ │ │ └── data-binding.component.ts │ │ ├── input-property │ │ │ ├── input-property.component.css │ │ │ ├── input-property.component.html │ │ │ └── input-property.component.ts │ │ ├── meu-form │ │ │ ├── meu-form.component.css │ │ │ ├── meu-form.component.html │ │ │ ├── meu-form.component.ts │ │ │ └── meu-form.module.ts │ │ └── output-property │ │ │ ├── output-property.component.css │ │ │ ├── output-property.component.html │ │ │ └── output-property.component.ts │ ├── assets │ │ └── .gitkeep │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ ├── polyfills.ts │ ├── styles.css │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── typings.d.ts ├── tsconfig.base.json ├── tsconfig.json └── tslint.json ├── diretivas ├── .browserslistrc ├── .editorconfig ├── .gitignore ├── README.md ├── angular.json ├── e2e │ ├── app.e2e-spec.ts │ ├── app.po.ts │ └── tsconfig.e2e.json ├── karma.conf.js ├── package-lock.json ├── package.json ├── protractor.conf.js ├── src │ ├── app │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── diretiva-ngclass │ │ │ ├── diretiva-ngclass.component.css │ │ │ ├── diretiva-ngclass.component.html │ │ │ └── diretiva-ngclass.component.ts │ │ ├── diretiva-ngfor │ │ │ ├── diretiva-ngfor.component.css │ │ │ ├── diretiva-ngfor.component.html │ │ │ └── diretiva-ngfor.component.ts │ │ ├── diretiva-ngif │ │ │ ├── diretiva-ngif.component.css │ │ │ ├── diretiva-ngif.component.html │ │ │ └── diretiva-ngif.component.ts │ │ ├── diretiva-ngstyle │ │ │ ├── diretiva-ngstyle.component.css │ │ │ ├── diretiva-ngstyle.component.html │ │ │ └── diretiva-ngstyle.component.ts │ │ ├── diretiva-ngswitch │ │ │ ├── diretiva-ngswitch.component.css │ │ │ ├── diretiva-ngswitch.component.html │ │ │ └── diretiva-ngswitch.component.ts │ │ ├── diretivas-customizadas │ │ │ ├── diretivas-customizadas.component.css │ │ │ ├── diretivas-customizadas.component.html │ │ │ └── diretivas-customizadas.component.ts │ │ ├── exemplo-ng-content │ │ │ ├── exemplo-ng-content.component.css │ │ │ ├── exemplo-ng-content.component.html │ │ │ └── exemplo-ng-content.component.ts │ │ ├── operador-elvis │ │ │ ├── operador-elvis.component.css │ │ │ ├── operador-elvis.component.html │ │ │ └── operador-elvis.component.ts │ │ └── shared │ │ │ ├── fundo-amarelo.directive.ts │ │ │ ├── highlight-mouse.directive.ts │ │ │ ├── highlight.directive.ts │ │ │ └── ng-else.directive.ts │ ├── assets │ │ └── .gitkeep │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ ├── polyfills.ts │ ├── styles.css │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── typings.d.ts ├── tsconfig.base.json ├── tsconfig.json └── tslint.json ├── forms ├── .angulardoc.json ├── .browserslistrc ├── .editorconfig ├── .gitignore ├── .vscode │ └── settings.json ├── README.md ├── angular.json ├── e2e │ ├── app.e2e-spec.ts │ ├── app.po.ts │ └── tsconfig.e2e.json ├── karma.conf.js ├── package-lock.json ├── package.json ├── protractor.conf.js ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── data-form │ │ │ ├── data-form.component.css │ │ │ ├── data-form.component.html │ │ │ ├── data-form.component.naorefatorado.html │ │ │ ├── data-form.component.ts │ │ │ ├── data-form.module.ts │ │ │ └── services │ │ │ │ ├── verifica-email.service.spec.ts │ │ │ │ └── verifica-email.service.ts │ │ ├── shared │ │ │ ├── base-form │ │ │ │ ├── base-form.component.spec.ts │ │ │ │ └── base-form.component.ts │ │ │ ├── campo-control-erro │ │ │ │ ├── campo-control-erro.component.css │ │ │ │ ├── campo-control-erro.component.html │ │ │ │ └── campo-control-erro.component.ts │ │ │ ├── error-msg │ │ │ │ ├── error-msg.component.css │ │ │ │ ├── error-msg.component.html │ │ │ │ ├── error-msg.component.spec.ts │ │ │ │ └── error-msg.component.ts │ │ │ ├── form-debug │ │ │ │ ├── form-debug.component.css │ │ │ │ ├── form-debug.component.html │ │ │ │ └── form-debug.component.ts │ │ │ ├── form-validations.ts │ │ │ ├── input-field │ │ │ │ ├── input-field.component.css │ │ │ │ ├── input-field.component.html │ │ │ │ ├── input-field.component.spec.ts │ │ │ │ └── input-field.component.ts │ │ │ ├── models │ │ │ │ ├── cidade.ts │ │ │ │ └── estado-br.model.ts │ │ │ ├── services │ │ │ │ ├── consulta-cep.service.spec.ts │ │ │ │ ├── consulta-cep.service.ts │ │ │ │ └── dropdown.service.ts │ │ │ └── shared.module.ts │ │ └── template-form │ │ │ ├── template-form.component.css │ │ │ ├── template-form.component.html │ │ │ ├── template-form.component.ts │ │ │ └── template-form.module.ts │ ├── assets │ │ ├── .gitkeep │ │ └── dados │ │ │ ├── cidades.json │ │ │ ├── estadosbr.json │ │ │ └── verificarEmail.json │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ ├── polyfills.ts │ ├── styles.css │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── typings.d.ts ├── tsconfig.base.json ├── tsconfig.json └── tslint.json ├── hello-tyspescript ├── main.js └── main.ts ├── novidades-v9 ├── .angulardoc.json ├── .browserslistrc ├── .editorconfig ├── .gitignore ├── .vscode │ └── settings.json ├── README.md ├── angular.json ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.json ├── karma.conf.js ├── package.json ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.html │ │ ├── app.component.scss │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── novidades-typescript │ │ │ ├── novidades-typescript-routing.module.ts │ │ │ ├── novidades-typescript.module.ts │ │ │ └── novidades │ │ │ ├── novidades.component.html │ │ │ ├── novidades.component.scss │ │ │ └── novidades.component.ts │ ├── assets │ │ └── .gitkeep │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ ├── polyfills.ts │ ├── styles.scss │ └── test.ts ├── tsconfig.app.json ├── tsconfig.base.json ├── tsconfig.json ├── tsconfig.spec.json └── tslint.json ├── pipes ├── .browserslistrc ├── .editorconfig ├── .gitignore ├── README.md ├── angular.json ├── e2e │ ├── app.e2e-spec.ts │ ├── app.po.ts │ └── tsconfig.e2e.json ├── karma.conf.js ├── package-lock.json ├── package.json ├── protractor.conf.js ├── src │ ├── app │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── camel-case.pipe.ts │ │ ├── exemplos-pipes │ │ │ ├── exemplos-pipes.component.css │ │ │ ├── exemplos-pipes.component.html │ │ │ └── exemplos-pipes.component.ts │ │ ├── filtro-array-impuro.pipe.ts │ │ ├── filtro-array.pipe.ts │ │ ├── pt-br-locale.ts │ │ └── settings.service.ts │ ├── assets │ │ └── .gitkeep │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ ├── polyfills.ts │ ├── styles.css │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── typings.d.ts ├── tsconfig.base.json ├── tsconfig.json └── tslint.json ├── primeiro-projeto ├── .browserslistrc ├── .editorconfig ├── .gitignore ├── README.md ├── angular.json ├── e2e │ ├── app.e2e-spec.ts │ ├── app.po.ts │ └── tsconfig.e2e.json ├── karma.conf.js ├── package-lock.json ├── package.json ├── protractor.conf.js ├── src │ ├── app │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── cursos │ │ │ ├── curso-detalhe │ │ │ │ ├── curso-detalhe.component.css │ │ │ │ ├── curso-detalhe.component.html │ │ │ │ └── curso-detalhe.component.ts │ │ │ ├── cursos.component.css │ │ │ ├── cursos.component.html │ │ │ ├── cursos.component.ts │ │ │ ├── cursos.module.ts │ │ │ └── cursos.service.ts │ │ ├── meu-primeiro │ │ │ └── meu-primeiro.component.ts │ │ └── meu-primeiro2 │ │ │ ├── meu-primeiro2.component.css │ │ │ ├── meu-primeiro2.component.html │ │ │ └── meu-primeiro2.component.ts │ ├── assets │ │ └── .gitkeep │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ ├── polyfills.ts │ ├── styles.css │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── typings.d.ts ├── tsconfig.base.json ├── tsconfig.json └── tslint.json ├── requests-http ├── .angulardoc.json ├── .browserslistrc ├── .dockerignore ├── .editorconfig ├── .firebaserc ├── .gitignore ├── .vscode │ └── launch.json ├── Dockerfile ├── README.md ├── angular.json ├── config │ └── nginx.conf ├── db.json ├── docker-compose.yml ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.e2e.json ├── exemplo.http ├── firebase.json ├── package-lock.json ├── package.json ├── proxy.conf.js ├── proxy.conf.json ├── server │ ├── package.json │ └── src │ │ └── index.js ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.html │ │ ├── app.component.scss │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── cursos │ │ │ ├── curso.ts │ │ │ ├── cursos-form │ │ │ │ ├── cursos-form.component.html │ │ │ │ ├── cursos-form.component.scss │ │ │ │ └── cursos-form.component.ts │ │ │ ├── cursos-lista │ │ │ │ ├── cursos-lista.component.html │ │ │ │ ├── cursos-lista.component.scss │ │ │ │ └── cursos-lista.component.ts │ │ │ ├── cursos-routing.module.ts │ │ │ ├── cursos.module.ts │ │ │ ├── cursos.service.ts │ │ │ ├── cursos2.service.ts │ │ │ └── guards │ │ │ │ └── curso-resolver.guard.ts │ │ ├── reactive-search │ │ │ ├── lib-search │ │ │ │ ├── lib-search.component.html │ │ │ │ ├── lib-search.component.scss │ │ │ │ └── lib-search.component.ts │ │ │ ├── reactive-search-routing.module.ts │ │ │ └── reactive-search.module.ts │ │ ├── shared │ │ │ ├── alert-modal.service.ts │ │ │ ├── alert-modal │ │ │ │ ├── alert-modal.component.html │ │ │ │ ├── alert-modal.component.scss │ │ │ │ └── alert-modal.component.ts │ │ │ ├── confirm-modal │ │ │ │ ├── confirm-modal.component.html │ │ │ │ ├── confirm-modal.component.scss │ │ │ │ └── confirm-modal.component.ts │ │ │ ├── crud-service.ts │ │ │ ├── rxjs-operators.ts │ │ │ └── shared.module.ts │ │ ├── unsubscribe-rxjs │ │ │ ├── componentes │ │ │ │ ├── poc-async.component.ts │ │ │ │ ├── poc-take-until.component.ts │ │ │ │ ├── poc-take.component.ts │ │ │ │ ├── poc-unsub.component.ts │ │ │ │ └── poc.component.ts │ │ │ ├── enviar-valor.service.ts │ │ │ ├── poc-base │ │ │ │ ├── poc-base.component.html │ │ │ │ ├── poc-base.component.scss │ │ │ │ └── poc-base.component.ts │ │ │ ├── unsubscribe-poc │ │ │ │ ├── unsubscribe-poc.component.html │ │ │ │ ├── unsubscribe-poc.component.scss │ │ │ │ └── unsubscribe-poc.component.ts │ │ │ ├── unsubscribe-rxjs-routing.module.ts │ │ │ └── unsubscribe-rxjs.module.ts │ │ └── upload-file │ │ │ ├── upload-file-routing.module.ts │ │ │ ├── upload-file.module.ts │ │ │ ├── upload-file.service.ts │ │ │ └── upload-file │ │ │ ├── upload-file.component.html │ │ │ ├── upload-file.component.scss │ │ │ └── upload-file.component.ts │ ├── assets │ │ └── .gitkeep │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── karma.conf.js │ ├── main.ts │ ├── polyfills.ts │ ├── styles.scss │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── tslint.json ├── tsconfig.base.json ├── tsconfig.json └── tslint.json ├── rotas ├── .editorconfig ├── .gitignore ├── README.md ├── angular.json ├── e2e │ ├── app.e2e-spec.ts │ ├── app.po.ts │ └── tsconfig.e2e.json ├── karma.conf.js ├── package.json ├── protractor.conf.js ├── src │ ├── app │ │ ├── alunos │ │ │ ├── aluno-detalhe │ │ │ │ ├── aluno-detalhe.component.css │ │ │ │ ├── aluno-detalhe.component.html │ │ │ │ └── aluno-detalhe.component.ts │ │ │ ├── aluno-form │ │ │ │ ├── aluno-form.component.css │ │ │ │ ├── aluno-form.component.html │ │ │ │ └── aluno-form.component.ts │ │ │ ├── aluno.ts │ │ │ ├── alunos.component.css │ │ │ ├── alunos.component.html │ │ │ ├── alunos.component.ts │ │ │ ├── alunos.module.ts │ │ │ ├── alunos.routing.module.ts │ │ │ ├── alunos.service.ts │ │ │ └── guards │ │ │ │ └── aluno-detalhe.resolver.ts │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── app.routing.module.ts │ │ ├── app.routing.ts │ │ ├── cursos │ │ │ ├── curso-detalhe │ │ │ │ ├── curso-detalhe.component.css │ │ │ │ ├── curso-detalhe.component.html │ │ │ │ └── curso-detalhe.component.ts │ │ │ ├── curso-form │ │ │ │ ├── curso-form.component.css │ │ │ │ ├── curso-form.component.html │ │ │ │ └── curso-form.component.ts │ │ │ ├── curso-nao-encontrado │ │ │ │ ├── curso-nao-encontrado.component.css │ │ │ │ ├── curso-nao-encontrado.component.html │ │ │ │ └── curso-nao-encontrado.component.ts │ │ │ ├── cursos.component.css │ │ │ ├── cursos.component.html │ │ │ ├── cursos.component.ts │ │ │ ├── cursos.module.ts │ │ │ ├── cursos.routing.module.ts │ │ │ └── cursos.service.ts │ │ ├── guards │ │ │ ├── alunos-deactivate.guard.ts │ │ │ ├── alunos.guard.ts │ │ │ ├── auth.guard.ts │ │ │ ├── cursos.guard.ts │ │ │ └── iform-candeactivate.ts │ │ ├── home │ │ │ ├── home.component.css │ │ │ ├── home.component.html │ │ │ └── home.component.ts │ │ ├── login │ │ │ ├── auth.service.ts │ │ │ ├── login.component.css │ │ │ ├── login.component.html │ │ │ ├── login.component.ts │ │ │ └── usuario.ts │ │ └── pagina-nao-encontrada │ │ │ ├── pagina-nao-encontrada.component.css │ │ │ ├── pagina-nao-encontrada.component.html │ │ │ └── pagina-nao-encontrada.component.ts │ ├── assets │ │ └── .gitkeep │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ ├── polyfills.ts │ ├── styles.css │ ├── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ └── typings.d.ts ├── tsconfig.json └── tslint.json └── servicos ├── .browserslistrc ├── .editorconfig ├── .gitignore ├── README.md ├── angular.json ├── e2e ├── app.e2e-spec.ts ├── app.po.ts └── tsconfig.e2e.json ├── karma.conf.js ├── package-lock.json ├── package.json ├── protractor.conf.js ├── src ├── app │ ├── app.component.css │ ├── app.component.html │ ├── app.component.ts │ ├── app.module.ts │ ├── criar-curso │ │ ├── criar-curso.component.css │ │ ├── criar-curso.component.html │ │ ├── criar-curso.component.ts │ │ └── criar-curso.module.ts │ ├── cursos │ │ ├── cursos.component.css │ │ ├── cursos.component.html │ │ ├── cursos.component.ts │ │ ├── cursos.module.ts │ │ └── cursos.service.ts │ ├── receber-curso-criado │ │ ├── receber-curso-criado.component.css │ │ ├── receber-curso-criado.component.html │ │ └── receber-curso-criado.component.ts │ └── shared │ │ └── log.service.ts ├── assets │ └── .gitkeep ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── favicon.ico ├── index.html ├── main.ts ├── polyfills.ts ├── styles.css ├── test.ts ├── tsconfig.app.json ├── tsconfig.spec.json └── typings.d.ts ├── tsconfig.base.json ├── tsconfig.json └── tslint.json /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Curso Angular", 3 | "appPort": [3000,4200], 4 | "postCreateCommand": "bash .devcontainer/postCreate.sh" 5 | } -------------------------------------------------------------------------------- /.devcontainer/postCreate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd ~/workspace/angularv61 4 | npm i 5 | cd ~/workspace/data-binding 6 | npm i 7 | cd ~/workspace/data-binding 8 | npm i 9 | cd ~/workspace/forms 10 | npm i 11 | cd ~/workspace/novidades-v9 12 | npm i 13 | cd ~/workspace/pipes 14 | npm i 15 | cd ~/workspace/primeiro-projeto 16 | npm i 17 | cd ~/workspace/requests-http 18 | npm i 19 | cd ~/workspace/servicos 20 | npm i 21 | cd ~/workspace 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | npm-debug.log 2 | 3 | 03-data-binding/app/**/*.js 4 | 02-primeiro-componente/app/**/*.js 5 | 6 | *.iml 7 | 8 | .idea/* 9 | 02-primeiro-componente/app/cursos/cursos.component.js 10 | 11 | 02-primeiro-componente/app/cursos/cursos.component.js 12 | .vscode/angulardoc.json 13 | forms/.vscode/settings.json 14 | requests-http/.vscode/settings.json 15 | requests-http/.firebase/ 16 | angularv61/package-lock.json 17 | novidades-v9/.angulardoc.json 18 | package-lock.json -------------------------------------------------------------------------------- /angular-cli-libs-externas/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /angular-cli-libs-externas/.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 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | testem.log 34 | /typings 35 | 36 | # e2e 37 | /e2e/*.js 38 | /e2e/*.map 39 | 40 | # System Files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /angular-cli-libs-externas/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('angular-cli-libs-externas App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /angular-cli-libs-externas/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /angular-cli-libs-externas/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "jasminewd2", 11 | "node" 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /angular-cli-libs-externas/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/angular-cli-libs-externas/src/app/app.component.css -------------------------------------------------------------------------------- /angular-cli-libs-externas/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | import * as _ from 'lodash'; 4 | 5 | @Component({ 6 | selector: 'app-root', 7 | templateUrl: './app.component.html', 8 | styleUrls: ['./app.component.css'] 9 | }) 10 | export class AppComponent { 11 | title = 'app works!'; 12 | 13 | list = _.map([1, 2, 3], (n) => `# ${n}`); 14 | } 15 | -------------------------------------------------------------------------------- /angular-cli-libs-externas/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { MaterializeModule } from 'angular2-materialize'; 5 | 6 | import { AppComponent } from './app.component'; 7 | 8 | @NgModule({ 9 | declarations: [ 10 | AppComponent 11 | ], 12 | imports: [ 13 | BrowserModule, 14 | MaterializeModule 15 | ], 16 | providers: [], 17 | bootstrap: [AppComponent] 18 | }) 19 | export class AppModule { } 20 | -------------------------------------------------------------------------------- /angular-cli-libs-externas/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/angular-cli-libs-externas/src/assets/.gitkeep -------------------------------------------------------------------------------- /angular-cli-libs-externas/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /angular-cli-libs-externas/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /angular-cli-libs-externas/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/angular-cli-libs-externas/src/favicon.ico -------------------------------------------------------------------------------- /angular-cli-libs-externas/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AngularCliLibsExternas 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /angular-cli-libs-externas/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule); 12 | -------------------------------------------------------------------------------- /angular-cli-libs-externas/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | /* @import "../node_modules/materialize-css/dist/css/materialize.css"; */ 3 | @import "~materialize-css/dist/css/materialize.css"; 4 | -------------------------------------------------------------------------------- /angular-cli-libs-externas/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "baseUrl": "./", 6 | "module": "es2015", 7 | "types": [] 8 | }, 9 | "exclude": [ 10 | "test.ts", 11 | "**/*.spec.ts" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /angular-cli-libs-externas/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | }, 13 | "files": [ 14 | "test.ts", 15 | "polyfills.ts" 16 | ], 17 | "include": [ 18 | "**/*.spec.ts", 19 | "**/*.d.ts" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /angular-cli-libs-externas/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /angular-cli-libs-externas/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "importHelpers": true, 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "target": "es5", 12 | "typeRoots": [ 13 | "node_modules/@types" 14 | ], 15 | "lib": [ 16 | "es2017", 17 | "dom" 18 | ], 19 | "module": "es2015", 20 | "baseUrl": "./" 21 | } 22 | } -------------------------------------------------------------------------------- /angularv61/.angulardoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "repoId": "0c48fee9-864b-4ff5-b2c1-9aa6436b9e6e", 3 | "lastSync": 0 4 | } -------------------------------------------------------------------------------- /angularv61/.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # For IE 9-11 support, please uncomment the last line of the file and adjust as needed 5 | > 0.5% 6 | last 2 versions 7 | Firefox ESR 8 | not dead 9 | # IE 9-11 -------------------------------------------------------------------------------- /angularv61/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /angularv61/.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 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | /typings 36 | 37 | # System Files 38 | .DS_Store 39 | Thumbs.db 40 | -------------------------------------------------------------------------------- /angularv61/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to angularv61!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /angularv61/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /angularv61/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /angularv61/src/app/alunos/alunos.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-alunos', 5 | templateUrl: './alunos.component.html', 6 | styles: [] 7 | }) 8 | export class AlunosComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /angularv61/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/angularv61/src/app/app.component.css -------------------------------------------------------------------------------- /angularv61/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, ViewEncapsulation } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'], 7 | encapsulation: ViewEncapsulation.ShadowDom 8 | }) 9 | export class AppComponent { 10 | title = 'angularv61'; 11 | } 12 | -------------------------------------------------------------------------------- /angularv61/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppRoutingModule } from './app-routing.module'; 5 | import { AppComponent } from './app.component'; 6 | import { KeyValueComponent } from './key-value/key-value.component'; 7 | import { CursosComponent } from './cursos/cursos.component'; 8 | import { AlunosComponent } from './alunos/alunos.component'; 9 | 10 | @NgModule({ 11 | declarations: [ 12 | AppComponent, 13 | KeyValueComponent, 14 | CursosComponent, 15 | AlunosComponent 16 | ], 17 | imports: [ 18 | BrowserModule, 19 | AppRoutingModule 20 | ], 21 | providers: [], 22 | bootstrap: [AppComponent] 23 | }) 24 | export class AppModule { } 25 | -------------------------------------------------------------------------------- /angularv61/src/app/cursos/cursos.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-cursos', 5 | templateUrl: './cursos.component.html', 6 | styles: [] 7 | }) 8 | export class CursosComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /angularv61/src/app/key-value/key-value.component.html: -------------------------------------------------------------------------------- 1 |
2 | 7 |
8 | ----- 9 |
10 | 15 |
-------------------------------------------------------------------------------- /angularv61/src/app/key-value/key-value.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-key-value', 5 | templateUrl: './key-value.component.html', 6 | styles: [] 7 | }) 8 | export class KeyValueComponent implements OnInit { 9 | 10 | cursos = [ 11 | { id: '1', nome: 'Angular'}, 12 | { id: '2', nome: 'Java'}, 13 | ]; 14 | 15 | cursosComparator(a: any, b: any) { 16 | if (a.key === b.key) { 17 | return 0; 18 | } 19 | return a.key > b.key ? -1 : 1; 20 | } 21 | 22 | constructor() { } 23 | 24 | ngOnInit() { 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /angularv61/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/angularv61/src/assets/.gitkeep -------------------------------------------------------------------------------- /angularv61/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /angularv61/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * In development mode, to ignore zone related error stack frames such as 11 | * `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can 12 | * import the following file, but please comment it out in production mode 13 | * because it will have performance impact when throw error 14 | */ 15 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 16 | -------------------------------------------------------------------------------- /angularv61/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/angularv61/src/favicon.ico -------------------------------------------------------------------------------- /angularv61/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Angularv61 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /angularv61/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /angularv61/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /angularv61/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /angularv61/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "files": [ 8 | "main.ts", 9 | "polyfills.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /angularv61/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /angularv61/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /angularv61/tsconfig.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "importHelpers": true, 6 | "outDir": "./dist/out-tsc", 7 | "sourceMap": true, 8 | "declaration": false, 9 | "module": "es2020", 10 | "moduleResolution": "node", 11 | "emitDecoratorMetadata": true, 12 | "experimentalDecorators": true, 13 | "target": "es2015", 14 | "typeRoots": [ 15 | "node_modules/@types" 16 | ], 17 | "lib": [ 18 | "es2017", 19 | "dom" 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /angularv61/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* 2 | This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience. 3 | It is not intended to be used to perform a compilation. 4 | 5 | To learn more about this file see: https://angular.io/config/solution-tsconfig. 6 | */ 7 | { 8 | "files": [], 9 | "references": [ 10 | { 11 | "path": "./src/tsconfig.app.json" 12 | }, 13 | { 14 | "path": "./src/tsconfig.spec.json" 15 | }, 16 | { 17 | "path": "./e2e/tsconfig.e2e.json" 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/.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 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/proxy.conf.js: -------------------------------------------------------------------------------- 1 | const PROXY_CONFIG = [ 2 | { 3 | context: ['/api'], 4 | target: 'http://localhost:8080/', 5 | secure: false, 6 | logLevel: 'debug' 7 | } 8 | ]; 9 | 10 | module.exports = PROXY_CONFIG; 11 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | CRUD Angular + Spring 3 | 4 | 5 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/crud-angular-spring/crud-angular/src/app/app.component.scss -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { RouterOutlet } from '@angular/router'; 3 | import { MatToolbarModule } from '@angular/material/toolbar'; 4 | 5 | @Component({ 6 | selector: 'app-root', 7 | templateUrl: './app.component.html', 8 | styleUrls: ['./app.component.scss'], 9 | standalone: true, 10 | imports: [MatToolbarModule, RouterOutlet] 11 | }) 12 | export class AppComponent { 13 | title = 'crud-angular'; 14 | } 15 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | 3 | export const APP_ROUTES: Routes = [ 4 | { path: '', pathMatch: 'full', redirectTo: 'courses' }, 5 | { 6 | path: 'courses', 7 | loadChildren: () => import('./courses/courses.routes').then(m => m.COURSES_ROUTES) 8 | } 9 | ]; 10 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/app/courses/components/courses-list/courses-list.component.scss: -------------------------------------------------------------------------------- 1 | .mat-table { 2 | overflow: auto; 3 | max-height: 600px; 4 | } 5 | 6 | .action-column { 7 | flex: 0 0 125px; 8 | } 9 | 10 | .action-column-header { 11 | margin: 0 auto; 12 | } 13 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/app/courses/components/courses-list/courses-list.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CoursesListComponent } from './courses-list.component'; 4 | 5 | describe('CoursesListComponent', () => { 6 | let component: CoursesListComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [CoursesListComponent] 12 | }) 13 | .compileComponents(); 14 | 15 | fixture = TestBed.createComponent(CoursesListComponent); 16 | component = fixture.componentInstance; 17 | fixture.detectChanges(); 18 | }); 19 | 20 | it('should create', () => { 21 | expect(component).toBeTruthy(); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/app/courses/containers/course-form/course-form.component.scss: -------------------------------------------------------------------------------- 1 | mat-card { 2 | max-width: 80%; 3 | margin: 2em auto; 4 | text-align: center; 5 | } 6 | 7 | .full-width{ 8 | width: 100%; 9 | } 10 | 11 | .min-width { 12 | width: 100%; 13 | min-width: 150px; 14 | } 15 | 16 | .btn-space { 17 | margin-left: 5px; 18 | } 19 | 20 | .actions-center { 21 | justify-content: center; 22 | } 23 | 24 | .form-array-error { 25 | text-align: left; 26 | } 27 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/app/courses/containers/courses/courses.component.scss: -------------------------------------------------------------------------------- 1 | mat-card { 2 | max-width: 80%; 3 | margin: 2em auto; 4 | text-align: center; 5 | } 6 | 7 | .column-flex { 8 | display: flex; 9 | flex-direction: column; 10 | min-width: 300px; 11 | } 12 | 13 | .loading-spinner { 14 | padding: 25px; 15 | background: rgba(0, 0, 0, 0.15); 16 | display: flex; 17 | align-items: center; 18 | justify-content: center; 19 | } 20 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/app/courses/containers/courses/courses.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { CoursesComponent } from './courses.component'; 4 | 5 | describe('CoursesComponent', () => { 6 | let component: CoursesComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | imports: [CoursesComponent] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(CoursesComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/app/courses/courses.routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | 3 | import { CourseFormComponent } from './containers/course-form/course-form.component'; 4 | import { CoursesComponent } from './containers/courses/courses.component'; 5 | import { CourseResolver } from './guards/course.resolver'; 6 | 7 | export const COURSES_ROUTES: Routes = [ 8 | { path: '', component: CoursesComponent }, 9 | { path: 'new', component: CourseFormComponent, resolve: { course: CourseResolver } }, 10 | { path: 'edit/:id', component: CourseFormComponent, resolve: { course: CourseResolver } } 11 | ]; 12 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/app/courses/guards/course.resolver.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { CourseResolver } from './course.resolver'; 4 | 5 | describe('CourseResolver', () => { 6 | let resolver: CourseResolver; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | resolver = TestBed.inject(CourseResolver); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(resolver).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/app/courses/guards/course.resolver.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; 3 | import { Observable, of } from 'rxjs'; 4 | 5 | import { Course } from '../model/course'; 6 | import { CoursesService } from '../services/courses.service'; 7 | 8 | @Injectable({ 9 | providedIn: 'root' 10 | }) 11 | export class CourseResolver { 12 | 13 | constructor(private service: CoursesService) { } 14 | 15 | resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { 16 | if (route.params && route.params['id']) { 17 | return this.service.loadById(route.params['id']); 18 | } 19 | return of({ _id: '', name: '', category: '', lessons: [] }); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/app/courses/model/course-page.ts: -------------------------------------------------------------------------------- 1 | import { Course } from "./course"; 2 | 3 | export interface CoursePage { 4 | courses: Course[]; 5 | totalElements: number; 6 | totalPages: number; 7 | } 8 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/app/courses/model/course.ts: -------------------------------------------------------------------------------- 1 | import { Lesson } from "./lesson"; 2 | 3 | export interface Course { 4 | _id: string; 5 | name: string; 6 | category: string; 7 | lessons?: Lesson[]; 8 | } 9 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/app/courses/model/lesson.ts: -------------------------------------------------------------------------------- 1 | export interface Lesson { 2 | id: string; 3 | name: string; 4 | youtubeUrl: string; 5 | } 6 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/app/courses/services/courses.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { CoursesService } from './courses.service'; 4 | 5 | describe('CoursesService', () => { 6 | let service: CoursesService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(CoursesService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/app/shared/components/confirmation-dialog/confirmation-dialog.component.html: -------------------------------------------------------------------------------- 1 |
2 |

{{ data }}

3 |
4 |
5 | 8 | 9 |
10 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/app/shared/components/confirmation-dialog/confirmation-dialog.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/crud-angular-spring/crud-angular/src/app/shared/components/confirmation-dialog/confirmation-dialog.component.scss -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/app/shared/components/error-dialog/error-dialog.component.html: -------------------------------------------------------------------------------- 1 |

Erro!

2 |
{{ data }}
3 |
4 | 5 |
6 | 7 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/app/shared/components/error-dialog/error-dialog.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/crud-angular-spring/crud-angular/src/app/shared/components/error-dialog/error-dialog.component.scss -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/app/shared/form/form-utils.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { FormUtilsService } from './form-utils.service'; 4 | 5 | describe('FormUtilsService', () => { 6 | let service: FormUtilsService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(FormUtilsService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/app/shared/pipes/category.pipe.spec.ts: -------------------------------------------------------------------------------- 1 | import { CategoryPipe } from './category.pipe'; 2 | 3 | describe('CategoryPipe', () => { 4 | it('create an instance', () => { 5 | const pipe = new CategoryPipe(); 6 | expect(pipe).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/app/shared/pipes/category.pipe.ts: -------------------------------------------------------------------------------- 1 | import { Pipe, PipeTransform } from '@angular/core'; 2 | 3 | @Pipe({ 4 | name: 'category', 5 | standalone: true 6 | }) 7 | export class CategoryPipe implements PipeTransform { 8 | 9 | transform(value: string): string { 10 | switch(value) { 11 | case 'front-end': return 'code'; 12 | case 'back-end': return 'computer'; 13 | } 14 | return 'code'; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/crud-angular-spring/crud-angular/src/assets/.gitkeep -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/assets/courses.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "_id": "1", "name": "Angular", "category": "front-end"} 3 | ] 4 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/plugins/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/crud-angular-spring/crud-angular/src/favicon.ico -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CrudAngular 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | @use '@angular/material' as mat; 3 | @include mat.core(); 4 | 5 | $custom-app-primary: mat.define-palette(mat.$blue-palette); 6 | $custom-app-secondary: mat.define-palette(mat.$indigo-palette, A200, A400, 700); 7 | $custom-app-warn: mat.define-palette(mat.$red-palette); 8 | 9 | $custom-theme: mat.define-light-theme( 10 | ( 11 | color: ( 12 | primary: $custom-app-primary, 13 | accent: $custom-app-secondary, 14 | warn: $custom-app-warn 15 | ) 16 | ) 17 | ); 18 | 19 | @include mat.all-component-themes($custom-theme); 20 | 21 | html, body { height: 100%; } 22 | body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; } 23 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | // First, initialize the Angular testing environment. 11 | getTestBed().initTestEnvironment( 12 | BrowserDynamicTestingModule, 13 | platformBrowserDynamicTesting(), 14 | { teardown: { destroyAfterEach: true }}, 15 | ); 16 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts", 10 | "src/polyfills.ts" 11 | ], 12 | "include": [ 13 | "src/**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-angular/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "src/**/*.spec.ts", 16 | "src/**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-spring.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/crud-angular-spring/crud-spring.zip -------------------------------------------------------------------------------- /crud-angular-spring/crud-spring/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-spring/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/crud-angular-spring/crud-spring/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /crud-angular-spring/crud-spring/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.3/apache-maven-3.8.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-spring/compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | mysql: 3 | image: 'mysql:latest' 4 | environment: 5 | - 'MYSQL_DATABASE=courses' 6 | - 'MYSQL_PASSWORD=secret' 7 | - 'MYSQL_ROOT_PASSWORD=verysecret' 8 | - 'MYSQL_USER=myuser' 9 | ports: 10 | - '3306:3306' 11 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-spring/src/main/java/com/loiane/dto/CoursePageDTO.java: -------------------------------------------------------------------------------- 1 | package com.loiane.dto; 2 | 3 | import java.util.List; 4 | 5 | public record CoursePageDTO(List courses, long totalElements, int totalPages) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-spring/src/main/java/com/loiane/dto/LessonDTO.java: -------------------------------------------------------------------------------- 1 | package com.loiane.dto; 2 | 3 | import org.hibernate.validator.constraints.Length; 4 | 5 | import jakarta.validation.constraints.NotBlank; 6 | import jakarta.validation.constraints.NotNull; 7 | 8 | public record LessonDTO( 9 | Long id, 10 | @NotNull @NotBlank @Length(min = 5, max = 100) String name, 11 | @NotNull @NotBlank @Length(min = 10, max = 11) String youtubeUrl) { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-spring/src/main/java/com/loiane/enums/Category.java: -------------------------------------------------------------------------------- 1 | package com.loiane.enums; 2 | 3 | public enum Category { 4 | BACK_END("Back-end"), FRONT_END("Front-end"); 5 | 6 | private String value; 7 | 8 | private Category(String value) { 9 | this.value = value; 10 | } 11 | 12 | public String getValue() { 13 | return value; 14 | } 15 | 16 | @Override 17 | public String toString() { 18 | return value; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-spring/src/main/java/com/loiane/enums/Status.java: -------------------------------------------------------------------------------- 1 | package com.loiane.enums; 2 | 3 | public enum Status { 4 | ACTIVE("Ativo"), INACTIVE("Inativo"); 5 | 6 | private String value; 7 | 8 | private Status(String value) { 9 | this.value = value; 10 | } 11 | 12 | public String getValue() { 13 | return value; 14 | } 15 | 16 | @Override 17 | public String toString() { 18 | return value; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-spring/src/main/java/com/loiane/exception/RecordNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.loiane.exception; 2 | 3 | public class RecordNotFoundException extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public RecordNotFoundException(Long id) { 8 | super("Registro não encontrado com o id: " + id); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-spring/src/main/java/com/loiane/repository/CourseRepository.java: -------------------------------------------------------------------------------- 1 | package com.loiane.repository; 2 | 3 | import com.loiane.model.Course; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | public interface CourseRepository extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-spring/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | # mysql 2 | spring.datasource.url=jdbc:mysql://localhost:3306/courses 3 | spring.datasource.username=myuser 4 | spring.datasource.password=secret 5 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 6 | spring.jpa.database-platform=org.hibernate.dialect.MySQL8Dialect 7 | spring.jpa.show-sql=true 8 | spring.jpa.hibernate.ddl-auto=create -------------------------------------------------------------------------------- /crud-angular-spring/crud-spring/src/main/resources/application-test.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:h2:mem:testdb 2 | spring.datasource.driverClassName=org.h2.Driver 3 | spring.datasource.username=sa 4 | spring.datasource.password=password 5 | spring.jpa.database-platform=org.hibernate.dialect.H2Dialect 6 | spring.jpa.show-sql=true 7 | #http://localhost:8080/h2-console/ 8 | -------------------------------------------------------------------------------- /crud-angular-spring/crud-spring/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.profiles.active=test 2 | 3 | server.error.include-stacktrace=never 4 | server.error.include-message=never 5 | 6 | spring.data.web.pageable.default-page-size=5 7 | spring.data.web.pageable.max-page-size=10 -------------------------------------------------------------------------------- /crud-angular-spring/crud-spring/src/test/java/com/loiane/CrudSpringApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.loiane; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CrudSpringApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /data-binding/.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # You can see what browsers were selected by your queries by running: 6 | # npx browserslist 7 | 8 | > 0.5% 9 | last 2 versions 10 | Firefox ESR 11 | not dead 12 | not IE 9-11 # For IE 9-11 support, remove 'not'. -------------------------------------------------------------------------------- /data-binding/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /data-binding/.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 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | testem.log 34 | /typings 35 | 36 | # e2e 37 | /e2e/*.js 38 | /e2e/*.map 39 | 40 | # System Files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /data-binding/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('data-binding App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /data-binding/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /data-binding/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "jasminewd2", 11 | "node" 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /data-binding/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/data-binding/src/app/app.component.css -------------------------------------------------------------------------------- /data-binding/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /data-binding/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'], 7 | }) 8 | export class AppComponent { 9 | 10 | valor: number = 5; 11 | 12 | deletarCiclo: boolean = false; 13 | 14 | mudarValor(){ 15 | this.valor++; 16 | } 17 | 18 | destruirClico(){ 19 | this.deletarCiclo = true; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /data-binding/src/app/ciclo/ciclo.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/data-binding/src/app/ciclo/ciclo.component.css -------------------------------------------------------------------------------- /data-binding/src/app/ciclo/ciclo.component.html: -------------------------------------------------------------------------------- 1 |

2 | Valor: {{ valorInicial }} 3 |

4 | -------------------------------------------------------------------------------- /data-binding/src/app/data-binding/data-binding.component.css: -------------------------------------------------------------------------------- 1 | .highlight { 2 | background-color: yellow; 3 | font-weight: bold; 4 | } -------------------------------------------------------------------------------- /data-binding/src/app/input-property/input-property.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/data-binding/src/app/input-property/input-property.component.css -------------------------------------------------------------------------------- /data-binding/src/app/input-property/input-property.component.html: -------------------------------------------------------------------------------- 1 |

2 | {{ nomeCurso }} 3 |

4 | -------------------------------------------------------------------------------- /data-binding/src/app/input-property/input-property.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-curso', 5 | templateUrl: './input-property.component.html', 6 | styleUrls: ['./input-property.component.css']//, 7 | //inputs: ['nomeCurso:nome'] 8 | }) 9 | export class InputPropertyComponent implements OnInit { 10 | 11 | @Input('nome') nomeCurso: string = ''; 12 | 13 | constructor() { } 14 | 15 | ngOnInit() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /data-binding/src/app/meu-form/meu-form.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/data-binding/src/app/meu-form/meu-form.component.css -------------------------------------------------------------------------------- /data-binding/src/app/meu-form/meu-form.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-meu-form', 5 | templateUrl: './meu-form.component.html', 6 | styleUrls: ['./meu-form.component.css'] 7 | }) 8 | export class MeuFormComponent implements OnInit { 9 | 10 | nome: string = 'abc'; 11 | 12 | pessoa: any = { 13 | nome: 'def', 14 | idade: 20 15 | } 16 | 17 | constructor() { } 18 | 19 | ngOnInit() { 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /data-binding/src/app/meu-form/meu-form.module.ts: -------------------------------------------------------------------------------- 1 | import { FormsModule } from '@angular/forms'; 2 | import { NgModule } from '@angular/core'; 3 | import { CommonModule } from '@angular/common'; 4 | import { MeuFormComponent } from './meu-form.component'; 5 | 6 | @NgModule({ 7 | imports: [ 8 | CommonModule, 9 | FormsModule 10 | ], 11 | declarations: [ 12 | MeuFormComponent 13 | ], 14 | exports: [MeuFormComponent] 15 | }) 16 | export class MeuFormModule { } 17 | -------------------------------------------------------------------------------- /data-binding/src/app/output-property/output-property.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/data-binding/src/app/output-property/output-property.component.css -------------------------------------------------------------------------------- /data-binding/src/app/output-property/output-property.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 |
6 | -------------------------------------------------------------------------------- /data-binding/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/data-binding/src/assets/.gitkeep -------------------------------------------------------------------------------- /data-binding/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /data-binding/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /data-binding/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/data-binding/src/favicon.ico -------------------------------------------------------------------------------- /data-binding/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | DataBinding 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /data-binding/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule); 12 | -------------------------------------------------------------------------------- /data-binding/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /data-binding/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "baseUrl": "./", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "main.ts", 10 | "polyfills.ts" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /data-binding/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "baseUrl": "./", 6 | "types": [ 7 | "jasmine", 8 | "node" 9 | ] 10 | }, 11 | "files": [ 12 | "test.ts", 13 | "polyfills.ts" 14 | ], 15 | "include": [ 16 | "**/*.spec.ts", 17 | "**/*.d.ts" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /data-binding/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /data-binding/tsconfig.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "importHelpers": true, 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "target": "es2015", 12 | "typeRoots": [ 13 | "node_modules/@types" 14 | ], 15 | "lib": [ 16 | "es2017", 17 | "dom" 18 | ], 19 | "module": "es2020", 20 | "baseUrl": "./" 21 | } 22 | } -------------------------------------------------------------------------------- /data-binding/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* 2 | This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience. 3 | It is not intended to be used to perform a compilation. 4 | 5 | To learn more about this file see: https://angular.io/config/solution-tsconfig. 6 | */ 7 | { 8 | "files": [], 9 | "references": [ 10 | { 11 | "path": "./src/tsconfig.app.json" 12 | }, 13 | { 14 | "path": "./src/tsconfig.spec.json" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /diretivas/.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # You can see what browsers were selected by your queries by running: 6 | # npx browserslist 7 | 8 | > 0.5% 9 | last 2 versions 10 | Firefox ESR 11 | not dead 12 | not IE 9-11 # For IE 9-11 support, remove 'not'. -------------------------------------------------------------------------------- /diretivas/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /diretivas/.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 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | testem.log 34 | /typings 35 | 36 | # e2e 37 | /e2e/*.js 38 | /e2e/*.map 39 | 40 | # System Files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /diretivas/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('diretivas App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /diretivas/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /diretivas/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "jasminewd2", 11 | "node" 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /diretivas/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/diretivas/src/app/app.component.css -------------------------------------------------------------------------------- /diretivas/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'app works!'; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /diretivas/src/app/diretiva-ngclass/diretiva-ngclass.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/diretivas/src/app/diretiva-ngclass/diretiva-ngclass.component.css -------------------------------------------------------------------------------- /diretivas/src/app/diretiva-ngclass/diretiva-ngclass.component.html: -------------------------------------------------------------------------------- 1 |

2 | 7 |

8 | 9 |

10 | 17 |

18 | -------------------------------------------------------------------------------- /diretivas/src/app/diretiva-ngclass/diretiva-ngclass.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-diretiva-ngclass', 5 | templateUrl: './diretiva-ngclass.component.html', 6 | styleUrls: ['./diretiva-ngclass.component.css'] 7 | }) 8 | export class DiretivaNgclassComponent implements OnInit { 9 | 10 | meuFavorito: boolean = false; 11 | 12 | constructor() { } 13 | 14 | ngOnInit() { 15 | } 16 | 17 | onClick(){ 18 | this.meuFavorito = !this.meuFavorito; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /diretivas/src/app/diretiva-ngfor/diretiva-ngfor.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/diretivas/src/app/diretiva-ngfor/diretiva-ngfor.component.css -------------------------------------------------------------------------------- /diretivas/src/app/diretiva-ngfor/diretiva-ngfor.component.html: -------------------------------------------------------------------------------- 1 |
Diretiva *ngFor
2 | 3 |
    4 |
  • 5 | {{ i + 1 }} - {{ curso }} 6 |
  • 7 |
8 | 9 |
Removendo o * e usando template
10 | 11 | 12 | 17 | 18 |
    19 | 20 |
  • 21 | {{ i + 1 }} - {{ curso }} 22 |
  • 23 |
    24 |
25 | -------------------------------------------------------------------------------- /diretivas/src/app/diretiva-ngfor/diretiva-ngfor.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-diretiva-ngfor', 5 | templateUrl: './diretiva-ngfor.component.html', 6 | styleUrls: ['./diretiva-ngfor.component.css'] 7 | }) 8 | export class DiretivaNgforComponent implements OnInit { 9 | 10 | cursos: string[] = ["Angular 2", "Java", "Phonegap"]; 11 | 12 | constructor() { } 13 | 14 | ngOnInit() { 15 | for (let i=0; iStyles com property binding (style binding) 2 | 11 |
12 | 13 | 14 |
Styles com diretiva ngStyle
15 | -------------------------------------------------------------------------------- /diretivas/src/app/diretiva-ngstyle/diretiva-ngstyle.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-diretiva-ngstyle', 5 | templateUrl: './diretiva-ngstyle.component.html', 6 | styleUrls: ['./diretiva-ngstyle.component.css'] 7 | }) 8 | export class DiretivaNgstyleComponent implements OnInit { 9 | 10 | ativo: boolean = false; 11 | tamanhoFonte: number = 10; 12 | 13 | constructor() { } 14 | 15 | ngOnInit() { 16 | } 17 | 18 | mudarAtivo(){ 19 | this.ativo = !this.ativo; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /diretivas/src/app/diretiva-ngswitch/diretiva-ngswitch.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/diretivas/src/app/diretiva-ngswitch/diretiva-ngswitch.component.css -------------------------------------------------------------------------------- /diretivas/src/app/diretiva-ngswitch/diretiva-ngswitch.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-diretiva-ngswitch', 5 | templateUrl: './diretiva-ngswitch.component.html', 6 | styleUrls: ['./diretiva-ngswitch.component.css'] 7 | }) 8 | export class DiretivaNgswitchComponent implements OnInit { 9 | 10 | aba: string = 'home'; 11 | 12 | constructor() { } 13 | 14 | ngOnInit() { 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /diretivas/src/app/diretivas-customizadas/diretivas-customizadas.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/diretivas/src/app/diretivas-customizadas/diretivas-customizadas.component.css -------------------------------------------------------------------------------- /diretivas/src/app/diretivas-customizadas/diretivas-customizadas.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-diretivas-customizadas', 5 | templateUrl: './diretivas-customizadas.component.html', 6 | styleUrls: ['./diretivas-customizadas.component.css'] 7 | }) 8 | export class DiretivasCustomizadasComponent implements OnInit { 9 | 10 | mostrarCursos: boolean = false; 11 | 12 | constructor() { } 13 | 14 | ngOnInit() { 15 | } 16 | 17 | onMostrarCursos(){ 18 | this.mostrarCursos = !this.mostrarCursos; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /diretivas/src/app/exemplo-ng-content/exemplo-ng-content.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/diretivas/src/app/exemplo-ng-content/exemplo-ng-content.component.css -------------------------------------------------------------------------------- /diretivas/src/app/exemplo-ng-content/exemplo-ng-content.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |
6 | 7 |
8 |
-------------------------------------------------------------------------------- /diretivas/src/app/exemplo-ng-content/exemplo-ng-content.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-exemplo-ng-content', 5 | templateUrl: './exemplo-ng-content.component.html', 6 | styleUrls: ['./exemplo-ng-content.component.css'] 7 | }) 8 | export class ExemploNgContentComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /diretivas/src/app/operador-elvis/operador-elvis.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/diretivas/src/app/operador-elvis/operador-elvis.component.css -------------------------------------------------------------------------------- /diretivas/src/app/operador-elvis/operador-elvis.component.html: -------------------------------------------------------------------------------- 1 |

Descrição: {{ tarefa.desc }}

2 | 3 | 4 |

Responsável: {{ tarefa.responsavel?.usuario?.nome }}

5 | -------------------------------------------------------------------------------- /diretivas/src/app/operador-elvis/operador-elvis.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-operador-elvis', 5 | templateUrl: './operador-elvis.component.html', 6 | styleUrls: ['./operador-elvis.component.css'] 7 | }) 8 | export class OperadorElvisComponent implements OnInit { 9 | 10 | tarefa: any = { 11 | desc: 'Descrição da tarefa', 12 | responsavel: { 13 | usuario: null 14 | } 15 | //responsavel : {nome: 'Loiane'} 16 | }; 17 | 18 | constructor() { } 19 | 20 | ngOnInit() { 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /diretivas/src/app/shared/fundo-amarelo.directive.ts: -------------------------------------------------------------------------------- 1 | import { Directive, ElementRef, Renderer2 } from '@angular/core'; 2 | 3 | @Directive({ 4 | selector: 'p[fundoAmarelo]' 5 | }) 6 | export class FundoAmareloDirective { 7 | 8 | constructor( 9 | private _elementRef: ElementRef, 10 | private _renderer: Renderer2 11 | ) { 12 | //console.log(this._elementRef); 13 | //this._elementRef.nativeElement.style.backgroundColor = 'yellow'; 14 | //console.log(this._elementRef); 15 | //this._elementRef.nativeElement.style.backgroundColor = 'yellow'; 16 | this._renderer.setStyle(this._elementRef.nativeElement, 'background-color', 'yellow'); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /diretivas/src/app/shared/highlight.directive.ts: -------------------------------------------------------------------------------- 1 | import { Directive, HostListener, HostBinding, 2 | Input } from '@angular/core'; 3 | 4 | @Directive({ 5 | selector: '[highlight]' 6 | }) 7 | export class HighlightDirective { 8 | 9 | @HostListener('mouseenter') onMouseOver(){ 10 | this.backgroundColor = this.highlightColor; 11 | } 12 | 13 | @HostListener('mouseleave') onMouseLeave(){ 14 | this.backgroundColor = this.defaultColor; 15 | } 16 | 17 | @HostBinding('style.backgroundColor') backgroundColor: string; 18 | 19 | @Input() defaultColor: string = 'white'; 20 | @Input('highlight') highlightColor: string = 'yellow'; 21 | 22 | constructor() { } 23 | 24 | ngOnInit(){ 25 | this.backgroundColor = this.defaultColor; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /diretivas/src/app/shared/ng-else.directive.ts: -------------------------------------------------------------------------------- 1 | import { Directive, Input, 2 | TemplateRef, ViewContainerRef } from '@angular/core'; 3 | 4 | @Directive({ 5 | selector: '[ngElse]' 6 | }) 7 | export class NgElseDirective { 8 | 9 | @Input() set ngElse(condition: boolean){ 10 | if (!condition){ 11 | this._viewContainerRef.createEmbeddedView(this._templateRef); 12 | } else { 13 | this._viewContainerRef.clear(); 14 | } 15 | } 16 | 17 | constructor( 18 | private _templateRef: TemplateRef, 19 | private _viewContainerRef: ViewContainerRef 20 | ) { } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /diretivas/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/diretivas/src/assets/.gitkeep -------------------------------------------------------------------------------- /diretivas/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /diretivas/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /diretivas/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/diretivas/src/favicon.ico -------------------------------------------------------------------------------- /diretivas/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Diretivas 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /diretivas/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule); 12 | -------------------------------------------------------------------------------- /diretivas/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | @import '~bootstrap/dist/css/bootstrap.css'; 3 | -------------------------------------------------------------------------------- /diretivas/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "baseUrl": "./", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "main.ts", 10 | "polyfills.ts" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /diretivas/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "baseUrl": "./", 6 | "types": [ 7 | "jasmine", 8 | "node" 9 | ] 10 | }, 11 | "files": [ 12 | "test.ts", 13 | "polyfills.ts" 14 | ], 15 | "include": [ 16 | "**/*.spec.ts", 17 | "**/*.d.ts" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /diretivas/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /diretivas/tsconfig.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "importHelpers": true, 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "target": "es2015", 12 | "typeRoots": [ 13 | "node_modules/@types" 14 | ], 15 | "lib": [ 16 | "es2017", 17 | "dom" 18 | ], 19 | "module": "es2020", 20 | "baseUrl": "./" 21 | } 22 | } -------------------------------------------------------------------------------- /diretivas/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* 2 | This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience. 3 | It is not intended to be used to perform a compilation. 4 | 5 | To learn more about this file see: https://angular.io/config/solution-tsconfig. 6 | */ 7 | { 8 | "files": [], 9 | "references": [ 10 | { 11 | "path": "./src/tsconfig.app.json" 12 | }, 13 | { 14 | "path": "./src/tsconfig.spec.json" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /forms/.angulardoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "repoId": "9bd46ab0-d5cc-4e08-8c7b-701bbf44f7ab", 3 | "lastSync": 0 4 | } -------------------------------------------------------------------------------- /forms/.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # You can see what browsers were selected by your queries by running: 6 | # npx browserslist 7 | 8 | > 0.5% 9 | last 2 versions 10 | Firefox ESR 11 | not dead 12 | not IE 9-11 # For IE 9-11 support, remove 'not'. -------------------------------------------------------------------------------- /forms/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /forms/.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 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | testem.log 34 | /typings 35 | 36 | # e2e 37 | /e2e/*.js 38 | /e2e/*.map 39 | 40 | # System Files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /forms/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "explorer.compactFolders": false 3 | // "editor.fontSize": 18, 4 | // "terminal.integrated.fontSize": 15 5 | } 6 | -------------------------------------------------------------------------------- /forms/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('forms App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /forms/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /forms/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "jasminewd2", 11 | "node" 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /forms/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { DataFormComponent } from './data-form/data-form.component'; 2 | import { TemplateFormComponent } from './template-form/template-form.component'; 3 | import { NgModule } from '@angular/core'; 4 | import { Routes, RouterModule } from '@angular/router'; 5 | 6 | const routes: Routes = [ 7 | { path: 'templateForm', component: TemplateFormComponent }, 8 | { path: 'dataForm', component: DataFormComponent }, 9 | { path: '', pathMatch: 'full', redirectTo: 'dataForm' } 10 | ]; 11 | 12 | @NgModule({ 13 | imports: [RouterModule.forRoot(routes)], 14 | exports: [RouterModule] 15 | }) 16 | export class AppRoutingModule { } 17 | -------------------------------------------------------------------------------- /forms/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/forms/src/app/app.component.css -------------------------------------------------------------------------------- /forms/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 18 | 19 |
20 | 21 |
-------------------------------------------------------------------------------- /forms/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'app works!'; 10 | } 11 | -------------------------------------------------------------------------------- /forms/src/app/data-form/data-form.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/forms/src/app/data-form/data-form.component.css -------------------------------------------------------------------------------- /forms/src/app/data-form/data-form.module.ts: -------------------------------------------------------------------------------- 1 | import { SharedModule } from './../shared/shared.module'; 2 | import { DataFormComponent } from './data-form.component'; 3 | import { NgModule } from '@angular/core'; 4 | import { CommonModule } from '@angular/common'; 5 | import { HttpClientModule } from '@angular/common/http'; 6 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; 7 | 8 | @NgModule({ 9 | imports: [ 10 | SharedModule, 11 | CommonModule, 12 | HttpClientModule, 13 | FormsModule, 14 | ReactiveFormsModule, 15 | ], 16 | declarations: [ 17 | DataFormComponent 18 | ] 19 | }) 20 | export class DataFormModule { } 21 | -------------------------------------------------------------------------------- /forms/src/app/data-form/services/verifica-email.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, inject } from '@angular/core/testing'; 2 | 3 | import { VerificaEmailService } from './verifica-email.service'; 4 | 5 | describe('VerificaEmailService', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [VerificaEmailService] 9 | }); 10 | }); 11 | 12 | it('should be created', inject([VerificaEmailService], (service: VerificaEmailService) => { 13 | expect(service).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /forms/src/app/shared/base-form/base-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { BaseFormComponent } from './base-form.component'; 4 | 5 | describe('BaseFormComponent', () => { 6 | let component: BaseFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ BaseFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(BaseFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /forms/src/app/shared/campo-control-erro/campo-control-erro.component.css: -------------------------------------------------------------------------------- 1 | .errorDiv { 2 | margin-bottom: 0px; 3 | } -------------------------------------------------------------------------------- /forms/src/app/shared/campo-control-erro/campo-control-erro.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | (error) 4 | 7 |
-------------------------------------------------------------------------------- /forms/src/app/shared/campo-control-erro/campo-control-erro.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-campo-control-erro', 5 | templateUrl: './campo-control-erro.component.html', 6 | styleUrls: ['./campo-control-erro.component.css'] 7 | }) 8 | export class CampoControlErroComponent implements OnInit { 9 | 10 | @Input() msgErro: string; 11 | @Input() mostrarErro: boolean; 12 | 13 | constructor() { } 14 | 15 | ngOnInit() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /forms/src/app/shared/error-msg/error-msg.component.css: -------------------------------------------------------------------------------- 1 | .errorDiv { 2 | margin-bottom: 0px; 3 | } 4 | -------------------------------------------------------------------------------- /forms/src/app/shared/error-msg/error-msg.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | (error) 4 | 7 |
8 | -------------------------------------------------------------------------------- /forms/src/app/shared/error-msg/error-msg.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ErrorMsgComponent } from './error-msg.component'; 4 | 5 | describe('ErrorMsgComponent', () => { 6 | let component: ErrorMsgComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ ErrorMsgComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ErrorMsgComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /forms/src/app/shared/form-debug/form-debug.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/forms/src/app/shared/form-debug/form-debug.component.css -------------------------------------------------------------------------------- /forms/src/app/shared/form-debug/form-debug.component.html: -------------------------------------------------------------------------------- 1 |
2 |
Detalhes do form
3 |
Form válido: {{ form.valid }}
4 | 5 |
Valores: 
{{ form.value | json }}
6 |
7 | -------------------------------------------------------------------------------- /forms/src/app/shared/form-debug/form-debug.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-form-debug', 5 | templateUrl: './form-debug.component.html', 6 | styleUrls: ['./form-debug.component.css'] 7 | }) 8 | export class FormDebugComponent implements OnInit { 9 | 10 | @Input() form; 11 | 12 | constructor() { } 13 | 14 | ngOnInit() { 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /forms/src/app/shared/input-field/input-field.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/forms/src/app/shared/input-field/input-field.component.css -------------------------------------------------------------------------------- /forms/src/app/shared/input-field/input-field.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 6 | 7 |
8 | -------------------------------------------------------------------------------- /forms/src/app/shared/input-field/input-field.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { InputFieldComponent } from './input-field.component'; 4 | 5 | describe('InputFieldComponent', () => { 6 | let component: InputFieldComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ InputFieldComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(InputFieldComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /forms/src/app/shared/models/cidade.ts: -------------------------------------------------------------------------------- 1 | export interface Cidade { 2 | id: number; 3 | nome: string; 4 | estado: number; 5 | } 6 | -------------------------------------------------------------------------------- /forms/src/app/shared/models/estado-br.model.ts: -------------------------------------------------------------------------------- 1 | export interface EstadoBr { 2 | id: number; 3 | sigla: string; 4 | nome: string; 5 | } 6 | -------------------------------------------------------------------------------- /forms/src/app/shared/services/consulta-cep.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, inject } from '@angular/core/testing'; 2 | 3 | import { ConsultaCepService } from './consulta-cep.service'; 4 | 5 | describe('ConsultaCepService', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [ConsultaCepService] 9 | }); 10 | }); 11 | 12 | it('should be created', inject([ConsultaCepService], (service: ConsultaCepService) => { 13 | expect(service).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /forms/src/app/template-form/template-form.component.css: -------------------------------------------------------------------------------- 1 | /*.ng-invalid.ng-touched:not(form) { 2 | border: 1px solid red; 3 | }*/ -------------------------------------------------------------------------------- /forms/src/app/template-form/template-form.module.ts: -------------------------------------------------------------------------------- 1 | import { SharedModule } from './../shared/shared.module'; 2 | import { TemplateFormComponent } from './template-form.component'; 3 | import { NgModule } from '@angular/core'; 4 | import { CommonModule } from '@angular/common'; 5 | import { HttpClientModule } from '@angular/common/http'; 6 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; 7 | 8 | @NgModule({ 9 | imports: [ 10 | SharedModule, 11 | CommonModule, 12 | HttpClientModule, 13 | FormsModule, 14 | ReactiveFormsModule, 15 | ], 16 | declarations: [ 17 | TemplateFormComponent 18 | ] 19 | }) 20 | export class TemplateFormModule { } 21 | -------------------------------------------------------------------------------- /forms/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/forms/src/assets/.gitkeep -------------------------------------------------------------------------------- /forms/src/assets/dados/verificarEmail.json: -------------------------------------------------------------------------------- 1 | { 2 | "emails": [ 3 | { "email": "email@email.com"}, 4 | { "email": "email1@email.com"}, 5 | { "email": "email2@email.com"}, 6 | { "email": "email3@email.com"}, 7 | { "email": "email4@email.com"}, 8 | { "email": "email5@email.com"} 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /forms/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /forms/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /forms/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/forms/src/favicon.ico -------------------------------------------------------------------------------- /forms/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Forms 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /forms/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule); 12 | -------------------------------------------------------------------------------- /forms/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /forms/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "baseUrl": "./", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "main.ts", 10 | "polyfills.ts" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /forms/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "baseUrl": "./", 6 | "types": [ 7 | "jasmine", 8 | "node" 9 | ] 10 | }, 11 | "files": [ 12 | "test.ts", 13 | "polyfills.ts" 14 | ], 15 | "include": [ 16 | "**/*.spec.ts", 17 | "**/*.d.ts" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /forms/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /forms/tsconfig.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "importHelpers": true, 5 | "module": "es2020", 6 | "outDir": "./dist/out-tsc", 7 | "sourceMap": true, 8 | "declaration": false, 9 | "moduleResolution": "node", 10 | "emitDecoratorMetadata": true, 11 | "experimentalDecorators": true, 12 | "target": "es2015", 13 | "typeRoots": [ 14 | "node_modules/@types" 15 | ], 16 | "lib": [ 17 | "es2017", 18 | "dom" 19 | ] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /forms/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* 2 | This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience. 3 | It is not intended to be used to perform a compilation. 4 | 5 | To learn more about this file see: https://angular.io/config/solution-tsconfig. 6 | */ 7 | { 8 | "files": [], 9 | "references": [ 10 | { 11 | "path": "./src/tsconfig.app.json" 12 | }, 13 | { 14 | "path": "./src/tsconfig.spec.json" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /hello-tyspescript/main.js: -------------------------------------------------------------------------------- 1 | var minhaVar = 'minha variavel'; 2 | function minhaFunc(x, y) { 3 | return x + y; 4 | } 5 | //ES 6 ou ES 2015 6 | var num = 2; 7 | var PI = 3.14; 8 | var numeros = [1, 2, 3]; 9 | numeros.map(function (valor) { 10 | return valor * 2; 11 | }); 12 | numeros.map(function (valor) { return valor * 2; }); //ES 2015 13 | var Matematica = (function () { 14 | function Matematica() { 15 | } 16 | Matematica.prototype.soma = function (x, y) { 17 | return x + y; 18 | }; 19 | return Matematica; 20 | }()); 21 | var n1 = 'sdfsdf'; 22 | n1 = 4; 23 | -------------------------------------------------------------------------------- /hello-tyspescript/main.ts: -------------------------------------------------------------------------------- 1 | var minhaVar = 'minha variavel'; 2 | 3 | function minhaFunc(x, y) { 4 | return x + y; 5 | } 6 | 7 | //ES 6 ou ES 2015 8 | let num = 2; 9 | const PI = 3.14; 10 | 11 | var numeros = [1, 2, 3]; 12 | numeros.map(function(valor) { 13 | return valor * 2; 14 | }); 15 | numeros.map(valor => valor * 2); //ES 2015 16 | 17 | class Matematica { 18 | soma(x, y){ 19 | return x + y; 20 | } 21 | } 22 | 23 | var n1 = 'sdfsdf'; 24 | n1 = 4; -------------------------------------------------------------------------------- /novidades-v9/.angulardoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "repoId": "726556a9-209a-4d4d-b755-58b0d5e80ced", 3 | "lastSync": 0 4 | } -------------------------------------------------------------------------------- /novidades-v9/.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # You can see what browsers were selected by your queries by running: 6 | # npx browserslist 7 | 8 | > 0.5% 9 | last 2 versions 10 | Firefox ESR 11 | not dead 12 | not IE 9-11 # For IE 9-11 support, remove 'not'. -------------------------------------------------------------------------------- /novidades-v9/.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 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /novidades-v9/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "explorer.compactFolders": false 3 | } -------------------------------------------------------------------------------- /novidades-v9/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | import { browser, logging } from 'protractor'; 3 | 4 | describe('workspace-project App', () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it('should display welcome message', () => { 12 | page.navigateTo(); 13 | expect(page.getTitleText()).toEqual('novidades-v9 app is running!'); 14 | }); 15 | 16 | afterEach(async () => { 17 | // Assert that there are no errors emitted from the browser 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 19 | expect(logs).not.toContain(jasmine.objectContaining({ 20 | level: logging.Level.SEVERE, 21 | } as logging.Entry)); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /novidades-v9/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo(): Promise { 5 | return browser.get(browser.baseUrl) as Promise; 6 | } 7 | 8 | getTitleText(): Promise { 9 | return element(by.css('app-root .content span')).getText() as Promise; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /novidades-v9/e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es2018", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /novidades-v9/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | 5 | const routes: Routes = [ 6 | { path: '', pathMatch: 'full', redirectTo: 'typescript' }, 7 | { 8 | path: 'typescript', 9 | loadChildren: () => import('./novidades-typescript/novidades-typescript.module').then(m => m.NovidadesTypescriptModule) 10 | }, 11 | ]; 12 | 13 | @NgModule({ 14 | imports: [RouterModule.forRoot(routes)], 15 | exports: [RouterModule] 16 | }) 17 | export class AppRoutingModule { } 18 | -------------------------------------------------------------------------------- /novidades-v9/src/app/app.component.scss: -------------------------------------------------------------------------------- 1 | .sidenav-container { 2 | height: 100%; 3 | } 4 | 5 | .sidenav { 6 | width: 200px; 7 | } 8 | 9 | .sidenav .mat-toolbar { 10 | background: inherit; 11 | } 12 | 13 | .mat-toolbar.mat-primary { 14 | position: sticky; 15 | top: 0; 16 | z-index: 1; 17 | } 18 | -------------------------------------------------------------------------------- /novidades-v9/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; 3 | import { Observable } from 'rxjs'; 4 | import { map, shareReplay } from 'rxjs/operators'; 5 | 6 | @Component({ 7 | selector: 'app-root', 8 | templateUrl: './app.component.html', 9 | styleUrls: ['./app.component.scss'] 10 | }) 11 | export class AppComponent { 12 | 13 | isHandset$: Observable = this.breakpointObserver.observe(Breakpoints.Handset) 14 | .pipe( 15 | map(result => result.matches), 16 | shareReplay() 17 | ); 18 | 19 | constructor(private breakpointObserver: BreakpointObserver) {} 20 | 21 | } 22 | -------------------------------------------------------------------------------- /novidades-v9/src/app/novidades-typescript/novidades-typescript-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | 4 | import { NovidadesComponent } from './novidades/novidades.component'; 5 | 6 | const routes: Routes = [ 7 | { path: '', component: NovidadesComponent } 8 | ]; 9 | 10 | @NgModule({ 11 | imports: [RouterModule.forChild(routes)], 12 | exports: [RouterModule] 13 | }) 14 | export class NovidadesTypescriptRoutingModule { } 15 | -------------------------------------------------------------------------------- /novidades-v9/src/app/novidades-typescript/novidades-typescript.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | import { NovidadesTypescriptRoutingModule } from './novidades-typescript-routing.module'; 5 | import { NovidadesComponent } from './novidades/novidades.component'; 6 | 7 | 8 | @NgModule({ 9 | declarations: [NovidadesComponent], 10 | imports: [ 11 | CommonModule, 12 | NovidadesTypescriptRoutingModule 13 | ] 14 | }) 15 | export class NovidadesTypescriptModule { } 16 | -------------------------------------------------------------------------------- /novidades-v9/src/app/novidades-typescript/novidades/novidades.component.html: -------------------------------------------------------------------------------- 1 |

Descrição: {{ tarefa.desc }}

2 | 3 |

Responsável: {{ tarefa.responsavel?.usuario?.nome }}

4 |

UpperCase: {{ upperCase() }}

5 | -------------------------------------------------------------------------------- /novidades-v9/src/app/novidades-typescript/novidades/novidades.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/novidades-v9/src/app/novidades-typescript/novidades/novidades.component.scss -------------------------------------------------------------------------------- /novidades-v9/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/novidades-v9/src/assets/.gitkeep -------------------------------------------------------------------------------- /novidades-v9/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /novidades-v9/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /novidades-v9/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/novidades-v9/src/favicon.ico -------------------------------------------------------------------------------- /novidades-v9/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NovidadesV9 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /novidades-v9/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /novidades-v9/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | 3 | html, body { height: 100%; } 4 | body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; } 5 | -------------------------------------------------------------------------------- /novidades-v9/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/app", 5 | "types": [] 6 | }, 7 | "files": [ 8 | "src/main.ts", 9 | "src/polyfills.ts" 10 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /novidades-v9/tsconfig.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "downlevelIteration": true, 9 | "experimentalDecorators": true, 10 | "module": "es2020", 11 | "moduleResolution": "node", 12 | "importHelpers": true, 13 | "target": "es2015", 14 | "typeRoots": [ 15 | "node_modules/@types" 16 | ], 17 | "lib": [ 18 | "es2018", 19 | "dom" 20 | ] 21 | }, 22 | "angularCompilerOptions": { 23 | "fullTemplateTypeCheck": true, 24 | "strictInjectionParameters": true 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /novidades-v9/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* 2 | This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience. 3 | It is not intended to be used to perform a compilation. 4 | 5 | To learn more about this file see: https://angular.io/config/solution-tsconfig. 6 | */ 7 | { 8 | "files": [], 9 | "references": [ 10 | { 11 | "path": "./tsconfig.app.json" 12 | }, 13 | { 14 | "path": "./tsconfig.spec.json" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /novidades-v9/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "src/**/*.spec.ts", 16 | "src/**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /pipes/.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # You can see what browsers were selected by your queries by running: 6 | # npx browserslist 7 | 8 | > 0.5% 9 | last 2 versions 10 | Firefox ESR 11 | not dead 12 | not IE 9-11 # For IE 9-11 support, remove 'not'. -------------------------------------------------------------------------------- /pipes/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /pipes/.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 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | testem.log 34 | /typings 35 | 36 | # e2e 37 | /e2e/*.js 38 | /e2e/*.map 39 | 40 | # System Files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /pipes/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('pipes App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /pipes/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /pipes/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "jasminewd2", 11 | "node" 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /pipes/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/pipes/src/app/app.component.css -------------------------------------------------------------------------------- /pipes/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /pipes/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'app works!'; 10 | } 11 | -------------------------------------------------------------------------------- /pipes/src/app/camel-case.pipe.ts: -------------------------------------------------------------------------------- 1 | import { Pipe, PipeTransform } from '@angular/core'; 2 | 3 | @Pipe({ 4 | name: 'camelCase' 5 | }) 6 | export class CamelCasePipe implements PipeTransform { 7 | 8 | transform(value: any, args?: any): any { 9 | let values = value.split(' '); 10 | let result = ''; 11 | 12 | for (let v of values){ 13 | result += this.capitalize(v) + ' '; 14 | } 15 | 16 | return result; 17 | } 18 | 19 | capitalize(value: string){ 20 | return value.substr(0,1).toUpperCase() + 21 | value.substr(1).toLowerCase(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /pipes/src/app/exemplos-pipes/exemplos-pipes.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/pipes/src/app/exemplos-pipes/exemplos-pipes.component.css -------------------------------------------------------------------------------- /pipes/src/app/filtro-array-impuro.pipe.ts: -------------------------------------------------------------------------------- 1 | import { Pipe, PipeTransform } from '@angular/core'; 2 | 3 | import { FiltroArrayPipe } from './filtro-array.pipe'; 4 | 5 | @Pipe({ 6 | name: 'filtroArrayImpuro', 7 | pure: false 8 | }) 9 | export class FiltroArrayImpuroPipe extends FiltroArrayPipe { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /pipes/src/app/filtro-array.pipe.ts: -------------------------------------------------------------------------------- 1 | import { Pipe, PipeTransform } from '@angular/core'; 2 | 3 | @Pipe({ 4 | name: 'filtroArray' 5 | }) 6 | export class FiltroArrayPipe implements PipeTransform { 7 | 8 | transform(value: any, args?: any): any { 9 | 10 | if (value.length === 0 || args === undefined){ 11 | return value; 12 | } 13 | 14 | let filter = args.toLocaleLowerCase(); 15 | return value.filter( 16 | v => v.toLocaleLowerCase().includes(filter) 17 | ); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /pipes/src/app/pt-br-locale.ts: -------------------------------------------------------------------------------- 1 | export const ptbrLocale = settingsService => settingsService.getLocale(); 2 | -------------------------------------------------------------------------------- /pipes/src/app/settings.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable() 4 | export class SettingsService { 5 | 6 | constructor() { } 7 | 8 | getLocale(){ 9 | return 'pt-BR'; 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /pipes/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/pipes/src/assets/.gitkeep -------------------------------------------------------------------------------- /pipes/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /pipes/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /pipes/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/pipes/src/favicon.ico -------------------------------------------------------------------------------- /pipes/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Pipes 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /pipes/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule); 12 | -------------------------------------------------------------------------------- /pipes/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /pipes/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "baseUrl": "./", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "main.ts", 10 | "polyfills.ts" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /pipes/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "baseUrl": "./", 6 | "types": [ 7 | "jasmine", 8 | "node" 9 | ] 10 | }, 11 | "files": [ 12 | "test.ts", 13 | "polyfills.ts" 14 | ], 15 | "include": [ 16 | "**/*.spec.ts", 17 | "**/*.d.ts" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /pipes/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /pipes/tsconfig.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "importHelpers": true, 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "target": "es2015", 12 | "typeRoots": [ 13 | "node_modules/@types" 14 | ], 15 | "lib": [ 16 | "es2017", 17 | "dom" 18 | ], 19 | "module": "es2020", 20 | "baseUrl": "./" 21 | } 22 | } -------------------------------------------------------------------------------- /pipes/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* 2 | This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience. 3 | It is not intended to be used to perform a compilation. 4 | 5 | To learn more about this file see: https://angular.io/config/solution-tsconfig. 6 | */ 7 | { 8 | "files": [], 9 | "references": [ 10 | { 11 | "path": "./src/tsconfig.app.json" 12 | }, 13 | { 14 | "path": "./src/tsconfig.spec.json" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /primeiro-projeto/.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # You can see what browsers were selected by your queries by running: 6 | # npx browserslist 7 | 8 | > 0.5% 9 | last 2 versions 10 | Firefox ESR 11 | not dead 12 | not IE 9-11 # For IE 9-11 support, remove 'not'. -------------------------------------------------------------------------------- /primeiro-projeto/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /primeiro-projeto/.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 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | testem.log 34 | /typings 35 | 36 | # e2e 37 | /e2e/*.js 38 | /e2e/*.map 39 | 40 | # System Files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /primeiro-projeto/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('primeiro-projeto App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /primeiro-projeto/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /primeiro-projeto/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "jasminewd2", 11 | "node" 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /primeiro-projeto/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/primeiro-projeto/src/app/app.component.css -------------------------------------------------------------------------------- /primeiro-projeto/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

2 | {{title}} 3 |

4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /primeiro-projeto/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'Olá Mundo!'; 10 | } 11 | -------------------------------------------------------------------------------- /primeiro-projeto/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppComponent } from './app.component'; 5 | import { MeuPrimeiroComponent } from './meu-primeiro/meu-primeiro.component'; 6 | import { MeuPrimeiro2Component } from './meu-primeiro2/meu-primeiro2.component'; 7 | import { CursosModule } from './cursos/cursos.module'; 8 | 9 | @NgModule({ 10 | declarations: [ 11 | AppComponent, 12 | MeuPrimeiroComponent, 13 | MeuPrimeiro2Component 14 | ], 15 | imports: [ 16 | BrowserModule, 17 | CursosModule 18 | ], 19 | providers: [], 20 | bootstrap: [AppComponent] 21 | }) 22 | export class AppModule { } 23 | -------------------------------------------------------------------------------- /primeiro-projeto/src/app/cursos/curso-detalhe/curso-detalhe.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/primeiro-projeto/src/app/cursos/curso-detalhe/curso-detalhe.component.css -------------------------------------------------------------------------------- /primeiro-projeto/src/app/cursos/curso-detalhe/curso-detalhe.component.html: -------------------------------------------------------------------------------- 1 |

2 | curso-detalhe works! 3 |

4 | -------------------------------------------------------------------------------- /primeiro-projeto/src/app/cursos/curso-detalhe/curso-detalhe.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-curso-detalhe', 5 | templateUrl: './curso-detalhe.component.html', 6 | styleUrls: ['./curso-detalhe.component.css'] 7 | }) 8 | export class CursoDetalheComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /primeiro-projeto/src/app/cursos/cursos.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/primeiro-projeto/src/app/cursos/cursos.component.css -------------------------------------------------------------------------------- /primeiro-projeto/src/app/cursos/cursos.component.html: -------------------------------------------------------------------------------- 1 |

2 | Lista de cursos do portal {{ nomePortal }} 3 |

4 | 5 | 6 | 7 |
    8 |
  • 9 | {{ curso }} 10 |
  • 11 |
-------------------------------------------------------------------------------- /primeiro-projeto/src/app/cursos/cursos.component.ts: -------------------------------------------------------------------------------- 1 | import { CursosService } from './cursos.service'; 2 | import { Component, OnInit } from '@angular/core'; 3 | 4 | @Component({ 5 | selector: 'app-cursos', 6 | templateUrl: './cursos.component.html', 7 | styleUrls: ['./cursos.component.css'] 8 | }) 9 | export class CursosComponent implements OnInit { 10 | 11 | nomePortal: string; 12 | 13 | cursos: string[]; 14 | 15 | constructor(private cursosService: CursosService) { 16 | this.nomePortal = 'http://loiane.training'; 17 | 18 | /*for (let i=0; iMeu primeiro component com Angular 2!

7 | ` 8 | }) 9 | export class MeuPrimeiroComponent { } 10 | -------------------------------------------------------------------------------- /primeiro-projeto/src/app/meu-primeiro2/meu-primeiro2.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/primeiro-projeto/src/app/meu-primeiro2/meu-primeiro2.component.css -------------------------------------------------------------------------------- /primeiro-projeto/src/app/meu-primeiro2/meu-primeiro2.component.html: -------------------------------------------------------------------------------- 1 |

2 | meu-primeiro2 works! 3 |

4 | 5 | 6 | -------------------------------------------------------------------------------- /primeiro-projeto/src/app/meu-primeiro2/meu-primeiro2.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-meu-primeiro2', 5 | templateUrl: './meu-primeiro2.component.html', 6 | styleUrls: ['./meu-primeiro2.component.css'] 7 | }) 8 | export class MeuPrimeiro2Component { 9 | 10 | 11 | 12 | } 13 | -------------------------------------------------------------------------------- /primeiro-projeto/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/primeiro-projeto/src/assets/.gitkeep -------------------------------------------------------------------------------- /primeiro-projeto/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /primeiro-projeto/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /primeiro-projeto/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/primeiro-projeto/src/favicon.ico -------------------------------------------------------------------------------- /primeiro-projeto/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PrimeiroProjeto 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /primeiro-projeto/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule); 12 | -------------------------------------------------------------------------------- /primeiro-projeto/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /primeiro-projeto/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "baseUrl": "./", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "main.ts", 10 | "polyfills.ts" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /primeiro-projeto/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "baseUrl": "./", 6 | "types": [ 7 | "jasmine", 8 | "node" 9 | ] 10 | }, 11 | "files": [ 12 | "test.ts", 13 | "polyfills.ts" 14 | ], 15 | "include": [ 16 | "**/*.spec.ts", 17 | "**/*.d.ts" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /primeiro-projeto/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /primeiro-projeto/tsconfig.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "importHelpers": true, 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "target": "es2015", 12 | "typeRoots": [ 13 | "node_modules/@types" 14 | ], 15 | "lib": [ 16 | "es2017", 17 | "dom" 18 | ], 19 | "module": "es2020", 20 | "baseUrl": "./" 21 | } 22 | } -------------------------------------------------------------------------------- /primeiro-projeto/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* 2 | This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience. 3 | It is not intended to be used to perform a compilation. 4 | 5 | To learn more about this file see: https://angular.io/config/solution-tsconfig. 6 | */ 7 | { 8 | "files": [], 9 | "references": [ 10 | { 11 | "path": "./src/tsconfig.app.json" 12 | }, 13 | { 14 | "path": "./src/tsconfig.spec.json" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /requests-http/.angulardoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "repoId": "8762e9bf-672c-4048-970b-555f7a4e024f", 3 | "lastSync": 0 4 | } -------------------------------------------------------------------------------- /requests-http/.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # For IE 9-11 support, please uncomment the last line of the file and adjust as needed 5 | > 0.5% 6 | last 2 versions 7 | Firefox ESR 8 | not dead 9 | IE 9-11 10 | -------------------------------------------------------------------------------- /requests-http/.dockerignore: -------------------------------------------------------------------------------- 1 | **/.classpath 2 | **/.dockerignore 3 | **/.env 4 | **/.git 5 | **/.gitignore 6 | **/.project 7 | **/.settings 8 | **/.toolstarget 9 | **/.vs 10 | **/.vscode 11 | **/*.*proj.user 12 | **/*.dbmdl 13 | **/*.jfm 14 | **/azds.yaml 15 | **/charts 16 | **/docker-compose* 17 | **/Dockerfile* 18 | **/node_modules 19 | **/npm-debug.log 20 | **/obj 21 | **/secrets.dev.yaml 22 | **/values.dev.yaml 23 | LICENSE 24 | README.md 25 | **/dist 26 | **/e2e 27 | **/server 28 | **/.firebase 29 | **/db.json 30 | -------------------------------------------------------------------------------- /requests-http/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /requests-http/.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "targets": { 3 | "curso-angular-loiane": { 4 | "hosting": { 5 | "requests-http": [ 6 | "curso-angular-loiane" 7 | ] 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /requests-http/.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 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | .vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | /typings 36 | 37 | # System Files 38 | .DS_Store 39 | Thumbs.db 40 | 41 | # node 42 | /server/node_modules 43 | /server/uploads 44 | -------------------------------------------------------------------------------- /requests-http/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "chrome", 9 | "request": "launch", 10 | "name": "Debug Angular", 11 | "url": "http://localhost:4200", 12 | "webRoot": "${workspaceFolder}" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /requests-http/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:10-alpine as angular 2 | WORKDIR /app 3 | COPY package.json /app 4 | RUN npm install --silent 5 | COPY . . 6 | RUN npm run build 7 | 8 | FROM nginx:alpine 9 | VOLUME /var/cache/nginx 10 | COPY --from=angular app/dist/requests-http /usr/share/nginx/html 11 | COPY ./config/nginx.conf /etc/nginx/conf.d/default.conf 12 | 13 | # docker build -t curso-angular . 14 | # docker run -p 8081:80 curso-angular 15 | -------------------------------------------------------------------------------- /requests-http/config/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 0.0.0.0:80; 3 | listen [::]:80; 4 | default_type application/octet-stream; 5 | 6 | gzip on; 7 | gzip_comp_level 6; 8 | gzip_vary on; 9 | gzip_min_length 1000; 10 | gzip_proxied any; 11 | gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; 12 | gzip_buffers 16 8k; 13 | client_max_body_size 256M; 14 | 15 | root /usr/share/nginx/html; 16 | 17 | location / { 18 | try_files $uri $uri/ /index.html =404; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /requests-http/db.json: -------------------------------------------------------------------------------- 1 | { 2 | "cursos": [ 3 | { 4 | "id": 1, 5 | "nome": "Angular" 6 | }, 7 | { 8 | "nome": "Java", 9 | "id": 2 10 | }, 11 | { 12 | "nome": "Angular Material", 13 | "id": 3 14 | }, 15 | { 16 | "nome": "Material", 17 | "id": 4 18 | }, 19 | { 20 | "nome": "Material 2", 21 | "id": 5 22 | }, 23 | { 24 | "nome": "Material 3", 25 | "id": 6 26 | }, 27 | { 28 | "id": 7, 29 | "nome": "Material 4" 30 | } 31 | ] 32 | } -------------------------------------------------------------------------------- /requests-http/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2.1' 2 | 3 | services: 4 | curso-angular: 5 | image: curso-angular 6 | build: . 7 | ports: 8 | - 8081:80 9 | -------------------------------------------------------------------------------- /requests-http/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to requests-http!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /requests-http/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /requests-http/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /requests-http/exemplo.http: -------------------------------------------------------------------------------- 1 | http://localhost:3000/cursos 2 | 3 | ### 4 | 5 | GET http://localhost:3000/cursos/1 6 | 7 | ### 8 | 9 | POST http://localhost:3000/cursos HTTP/1.1 10 | content-type: application/json 11 | 12 | { 13 | "nome": "Java" 14 | } 15 | 16 | ### 17 | 18 | PUT http://localhost:3000/cursos/2 HTTP/1.1 19 | content-type: application/json 20 | 21 | { 22 | "nome": "Java OO" 23 | } 24 | 25 | ### 26 | 27 | DELETE http://localhost:3000/cursos/2 28 | -------------------------------------------------------------------------------- /requests-http/firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "hosting": [ 3 | { 4 | "target": "requests-http", 5 | "public": "dist/requests-http", 6 | "ignore": [ 7 | "firebase.json", 8 | "**/.*", 9 | "**/node_modules/**" 10 | ], 11 | "rewrites": [ 12 | { 13 | "source": "**", 14 | "destination": "/index.html" 15 | } 16 | ] 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /requests-http/proxy.conf.js: -------------------------------------------------------------------------------- 1 | const PROXY_CONFIG = [ 2 | { 3 | context: ['/api'], 4 | target: 'http://localhost:8000/', 5 | secure: false, 6 | logLevel: 'debug', 7 | pathRewrite: { '^/api': '' } 8 | } 9 | ]; 10 | 11 | module.exports = PROXY_CONFIG; 12 | -------------------------------------------------------------------------------- /requests-http/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api/*": { 3 | "target": "http://localhost:8000", 4 | "secure": false, 5 | "logLevel": "debug", 6 | "pathRewrite": { 7 | "^/api": "" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /requests-http/server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "src/index.js", 6 | "scripts": { 7 | "start": "node src/index.js", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "body-parser": "^1.18.3", 15 | "connect-multiparty": "^2.2.0", 16 | "cors": "^2.8.5", 17 | "express": "^4.16.4" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /requests-http/src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/requests-http/src/app/app.component.scss -------------------------------------------------------------------------------- /requests-http/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.scss'] 7 | }) 8 | export class AppComponent { 9 | title = 'requests-http'; 10 | } 11 | -------------------------------------------------------------------------------- /requests-http/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import { ModalModule } from 'ngx-bootstrap/modal'; 4 | 5 | import { AppRoutingModule } from './app-routing.module'; 6 | import { AppComponent } from './app.component'; 7 | import { HttpClientModule } from '@angular/common/http'; 8 | import { SharedModule } from './shared/shared.module'; 9 | 10 | @NgModule({ 11 | declarations: [ 12 | AppComponent 13 | ], 14 | imports: [ 15 | BrowserModule, 16 | AppRoutingModule, 17 | HttpClientModule, 18 | ModalModule.forRoot(), 19 | SharedModule 20 | ], 21 | providers: [], 22 | bootstrap: [AppComponent] 23 | }) 24 | export class AppModule { } 25 | -------------------------------------------------------------------------------- /requests-http/src/app/cursos/curso.ts: -------------------------------------------------------------------------------- 1 | export interface Curso { 2 | id: number; 3 | nome: string; 4 | } 5 | -------------------------------------------------------------------------------- /requests-http/src/app/cursos/cursos-form/cursos-form.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/requests-http/src/app/cursos/cursos-form/cursos-form.component.scss -------------------------------------------------------------------------------- /requests-http/src/app/cursos/cursos-lista/cursos-lista.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/requests-http/src/app/cursos/cursos-lista/cursos-lista.component.scss -------------------------------------------------------------------------------- /requests-http/src/app/cursos/cursos.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { ReactiveFormsModule } from '@angular/forms'; 4 | 5 | import { CursosRoutingModule } from './cursos-routing.module'; 6 | import { CursosListaComponent } from './cursos-lista/cursos-lista.component'; 7 | import { CursosFormComponent } from './cursos-form/cursos-form.component'; 8 | 9 | @NgModule({ 10 | imports: [ 11 | CommonModule, 12 | CursosRoutingModule, 13 | ReactiveFormsModule 14 | ], 15 | declarations: [CursosListaComponent, CursosFormComponent] 16 | }) 17 | export class CursosModule { } 18 | -------------------------------------------------------------------------------- /requests-http/src/app/cursos/cursos2.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { CrudService } from '../shared/crud-service'; 3 | import { Curso } from './curso'; 4 | import { HttpClient } from '@angular/common/http'; 5 | import { environment } from '../../environments/environment'; 6 | 7 | @Injectable({ 8 | providedIn: 'root' 9 | }) 10 | export class Cursos2Service extends CrudService { 11 | 12 | constructor(protected http: HttpClient) { 13 | super(http, `${environment.API}cursos`); 14 | } 15 | 16 | loadByID(id) { 17 | return null; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /requests-http/src/app/reactive-search/lib-search/lib-search.component.scss: -------------------------------------------------------------------------------- 1 | .search-table{ 2 | padding: 10%; 3 | margin-top: -6%; 4 | } 5 | .search-box{ 6 | // background: #c1c1c1; 7 | border: 1px solid #ababab; 8 | padding: 3%; 9 | } 10 | .search-box input:focus{ 11 | box-shadow:none; 12 | border:2px solid #eeeeee; 13 | } 14 | .search-list{ 15 | background: #fff; 16 | border: 1px solid #ababab; 17 | border-top: none; 18 | } 19 | .search-list h3{ 20 | background: #eee; 21 | padding: 3%; 22 | margin-bottom: 0%; 23 | } 24 | -------------------------------------------------------------------------------- /requests-http/src/app/reactive-search/reactive-search-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { LibSearchComponent } from './lib-search/lib-search.component'; 4 | 5 | const routes: Routes = [ 6 | { 7 | path: '', component: LibSearchComponent 8 | } 9 | ]; 10 | 11 | @NgModule({ 12 | imports: [RouterModule.forChild(routes)], 13 | exports: [RouterModule] 14 | }) 15 | export class ReactiveSearchRoutingModule { } 16 | -------------------------------------------------------------------------------- /requests-http/src/app/reactive-search/reactive-search.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | import { ReactiveSearchRoutingModule } from './reactive-search-routing.module'; 5 | import { LibSearchComponent } from './lib-search/lib-search.component'; 6 | import { ReactiveFormsModule } from '@angular/forms'; 7 | 8 | @NgModule({ 9 | declarations: [LibSearchComponent], 10 | imports: [ 11 | CommonModule, 12 | ReactiveSearchRoutingModule, 13 | ReactiveFormsModule 14 | ] 15 | }) 16 | export class ReactiveSearchModule { } 17 | -------------------------------------------------------------------------------- /requests-http/src/app/shared/alert-modal/alert-modal.component.html: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /requests-http/src/app/shared/alert-modal/alert-modal.component.scss: -------------------------------------------------------------------------------- 1 | .no-margin { 2 | margin-bottom: 0; 3 | } 4 | -------------------------------------------------------------------------------- /requests-http/src/app/shared/alert-modal/alert-modal.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input } from '@angular/core'; 2 | import { BsModalRef } from 'ngx-bootstrap/modal'; 3 | 4 | @Component({ 5 | selector: 'app-alert-modal', 6 | templateUrl: './alert-modal.component.html', 7 | styleUrls: ['./alert-modal.component.scss'] 8 | }) 9 | export class AlertModalComponent implements OnInit { 10 | 11 | @Input() type = 'success'; 12 | @Input() message: string; 13 | 14 | constructor(public bsModalRef: BsModalRef) { } 15 | 16 | ngOnInit() { 17 | } 18 | 19 | onClose() { 20 | this.bsModalRef.hide(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /requests-http/src/app/shared/confirm-modal/confirm-modal.component.html: -------------------------------------------------------------------------------- 1 | 16 | -------------------------------------------------------------------------------- /requests-http/src/app/shared/confirm-modal/confirm-modal.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/requests-http/src/app/shared/confirm-modal/confirm-modal.component.scss -------------------------------------------------------------------------------- /requests-http/src/app/shared/rxjs-operators.ts: -------------------------------------------------------------------------------- 1 | import { pipe } from 'rxjs'; 2 | import { filter, map, tap } from 'rxjs/operators'; 3 | import { HttpEvent, HttpEventType, HttpResponse } from '@angular/common/http'; 4 | 5 | export function filterResponse() { 6 | return pipe( 7 | filter((event: HttpEvent) => event.type === HttpEventType.Response), 8 | map((res: HttpResponse) => res.body) 9 | ); 10 | } 11 | 12 | export function uploadProgress(cb: (progress: number) => void) { 13 | return tap((event: HttpEvent) => { 14 | if (event.type === HttpEventType.UploadProgress) { 15 | cb(Math.round((event.loaded * 100) / event.total)); 16 | } 17 | }); 18 | } 19 | -------------------------------------------------------------------------------- /requests-http/src/app/shared/shared.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { AlertModalComponent } from './alert-modal/alert-modal.component'; 4 | import { ConfirmModalComponent } from './confirm-modal/confirm-modal.component'; 5 | 6 | @NgModule({ 7 | imports: [ 8 | CommonModule 9 | ], 10 | declarations: [AlertModalComponent, ConfirmModalComponent], 11 | exports: [AlertModalComponent], 12 | // entryComponents não é necessário a partir do angular v9 13 | // entryComponents: [AlertModalComponent, ConfirmModalComponent] 14 | }) 15 | export class SharedModule { } 16 | -------------------------------------------------------------------------------- /requests-http/src/app/unsubscribe-rxjs/enviar-valor.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Subject } from 'rxjs'; 3 | 4 | @Injectable({ 5 | providedIn: 'root' 6 | }) 7 | export class EnviarValorService { 8 | 9 | private emissor$ = new Subject(); 10 | 11 | emitirValor(valor: string) { 12 | this.emissor$.next(valor); 13 | } 14 | 15 | getValor() { 16 | return this.emissor$.asObservable(); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /requests-http/src/app/unsubscribe-rxjs/poc-base/poc-base.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
{{ nome }}
4 |
5 |

{{ valor }}

6 |
7 |
8 |
-------------------------------------------------------------------------------- /requests-http/src/app/unsubscribe-rxjs/poc-base/poc-base.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/requests-http/src/app/unsubscribe-rxjs/poc-base/poc-base.component.scss -------------------------------------------------------------------------------- /requests-http/src/app/unsubscribe-rxjs/poc-base/poc-base.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-poc-base', 5 | templateUrl: './poc-base.component.html', 6 | styleUrls: ['./poc-base.component.scss'] 7 | }) 8 | export class PocBaseComponent implements OnInit { 9 | 10 | @Input() nome: string; 11 | @Input() valor: string; 12 | @Input() estilo: string; 13 | 14 | constructor() { } 15 | 16 | ngOnInit() { 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /requests-http/src/app/unsubscribe-rxjs/unsubscribe-poc/unsubscribe-poc.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/requests-http/src/app/unsubscribe-rxjs/unsubscribe-poc/unsubscribe-poc.component.scss -------------------------------------------------------------------------------- /requests-http/src/app/unsubscribe-rxjs/unsubscribe-poc/unsubscribe-poc.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { EnviarValorService } from '../enviar-valor.service'; 3 | 4 | @Component({ 5 | selector: 'app-unsubscribe-poc', 6 | templateUrl: './unsubscribe-poc.component.html', 7 | styleUrls: ['./unsubscribe-poc.component.scss'] 8 | }) 9 | export class UnsubscribePocComponent implements OnInit { 10 | 11 | mostrarComponentes = true; 12 | 13 | constructor(private service: EnviarValorService) { } 14 | 15 | ngOnInit() { 16 | } 17 | 18 | emitirValor(valor: string) { 19 | this.service.emitirValor(valor); 20 | } 21 | 22 | destruirComponentes() { 23 | this.mostrarComponentes = !this.mostrarComponentes; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /requests-http/src/app/unsubscribe-rxjs/unsubscribe-rxjs-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { UnsubscribePocComponent } from './unsubscribe-poc/unsubscribe-poc.component'; 4 | 5 | const routes: Routes = [ 6 | { 7 | path: '', component: UnsubscribePocComponent 8 | } 9 | ]; 10 | 11 | @NgModule({ 12 | imports: [RouterModule.forChild(routes)], 13 | exports: [RouterModule] 14 | }) 15 | export class UnsubscribeRxjsRoutingModule { } 16 | -------------------------------------------------------------------------------- /requests-http/src/app/upload-file/upload-file-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { UploadFileComponent } from './upload-file/upload-file.component'; 4 | 5 | const routes: Routes = [ 6 | { path: '', component: UploadFileComponent } 7 | ]; 8 | 9 | @NgModule({ 10 | imports: [RouterModule.forChild(routes)], 11 | exports: [RouterModule] 12 | }) 13 | export class UploadFileRoutingModule { } 14 | -------------------------------------------------------------------------------- /requests-http/src/app/upload-file/upload-file.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | import { UploadFileRoutingModule } from './upload-file-routing.module'; 5 | import { UploadFileComponent } from './upload-file/upload-file.component'; 6 | 7 | @NgModule({ 8 | declarations: [UploadFileComponent], 9 | imports: [ 10 | CommonModule, 11 | UploadFileRoutingModule 12 | ] 13 | }) 14 | export class UploadFileModule { } 15 | -------------------------------------------------------------------------------- /requests-http/src/app/upload-file/upload-file/upload-file.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/requests-http/src/app/upload-file/upload-file/upload-file.component.scss -------------------------------------------------------------------------------- /requests-http/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/requests-http/src/assets/.gitkeep -------------------------------------------------------------------------------- /requests-http/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | API: '/', 4 | BASE_URL: '' 5 | }; 6 | -------------------------------------------------------------------------------- /requests-http/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | API: 'http://localhost:8000/', 8 | BASE_URL: '/api' 9 | }; 10 | 11 | /* 12 | * In development mode, to ignore zone related error stack frames such as 13 | * `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can 14 | * import the following file, but please comment it out in production mode 15 | * because it will have performance impact when throw error 16 | */ 17 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 18 | -------------------------------------------------------------------------------- /requests-http/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/requests-http/src/favicon.ico -------------------------------------------------------------------------------- /requests-http/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | RequestsHttp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /requests-http/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /requests-http/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | @import '~bootstrap/dist/css/bootstrap.min.css'; 3 | -------------------------------------------------------------------------------- /requests-http/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /requests-http/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "files": [ 8 | "main.ts", 9 | "polyfills.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /requests-http/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /requests-http/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /requests-http/tsconfig.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "importHelpers": true, 6 | "outDir": "./dist/out-tsc", 7 | "sourceMap": true, 8 | "declaration": false, 9 | "module": "es2020", 10 | "moduleResolution": "node", 11 | "emitDecoratorMetadata": true, 12 | "experimentalDecorators": true, 13 | "target": "es2015", 14 | "typeRoots": [ 15 | "node_modules/@types" 16 | ], 17 | "lib": [ 18 | "es2017", 19 | "dom" 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /requests-http/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* 2 | This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience. 3 | It is not intended to be used to perform a compilation. 4 | 5 | To learn more about this file see: https://angular.io/config/solution-tsconfig. 6 | */ 7 | { 8 | "files": [], 9 | "references": [ 10 | { 11 | "path": "./src/tsconfig.app.json" 12 | }, 13 | { 14 | "path": "./src/tsconfig.spec.json" 15 | }, 16 | { 17 | "path": "./e2e/tsconfig.e2e.json" 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /rotas/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /rotas/.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 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | testem.log 34 | /typings 35 | 36 | # e2e 37 | /e2e/*.js 38 | /e2e/*.map 39 | 40 | # System Files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /rotas/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('rotas App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /rotas/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /rotas/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "jasminewd2", 11 | "node" 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /rotas/src/app/alunos/aluno-detalhe/aluno-detalhe.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/rotas/src/app/alunos/aluno-detalhe/aluno-detalhe.component.css -------------------------------------------------------------------------------- /rotas/src/app/alunos/aluno-detalhe/aluno-detalhe.component.html: -------------------------------------------------------------------------------- 1 |
2 | Detalhes do Aluno 3 |
4 | 5 |

Id: {{ aluno.id }}

6 |

Nome: {{ aluno.nome }}

7 |

Email: {{ aluno.email }}

8 | 9 | Editar -------------------------------------------------------------------------------- /rotas/src/app/alunos/aluno-form/aluno-form.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/rotas/src/app/alunos/aluno-form/aluno-form.component.css -------------------------------------------------------------------------------- /rotas/src/app/alunos/aluno.ts: -------------------------------------------------------------------------------- 1 | 2 | export class Aluno { 3 | 4 | constructor( 5 | public id: number, 6 | public nome: string, 7 | public email: string 8 | ){} 9 | } -------------------------------------------------------------------------------- /rotas/src/app/alunos/alunos.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/rotas/src/app/alunos/alunos.component.css -------------------------------------------------------------------------------- /rotas/src/app/alunos/alunos.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | Lista de Alunos 5 |

6 | 7 | 14 |
15 | 16 |
17 | 18 |
19 |
-------------------------------------------------------------------------------- /rotas/src/app/alunos/alunos.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | import { AlunosService } from './alunos.service'; 4 | 5 | @Component({ 6 | selector: 'app-alunos', 7 | templateUrl: './alunos.component.html', 8 | styleUrls: ['./alunos.component.css'] 9 | }) 10 | export class AlunosComponent implements OnInit { 11 | 12 | private alunos: any[] = []; 13 | 14 | constructor(private alunosService: AlunosService) { } 15 | 16 | ngOnInit() { 17 | this.alunos = this.alunosService.getAlunos(); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /rotas/src/app/alunos/alunos.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Aluno } from './aluno'; 3 | 4 | @Injectable() 5 | export class AlunosService { 6 | 7 | private alunos: Aluno[] = [ 8 | {id: 1, nome: 'Aluno 01', email: 'aluno01@email.com'}, 9 | {id: 2, nome: 'Aluno 02', email: 'aluno02@email.com'}, 10 | {id: 3, nome: 'Aluno 03', email: 'aluno03@email.com'} 11 | ]; 12 | 13 | getAlunos(){ 14 | return this.alunos; 15 | } 16 | 17 | getAluno(id: number){ 18 | for (let i=0; i this.mostrarMenu = mostrar 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /rotas/src/app/cursos/curso-detalhe/curso-detalhe.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/rotas/src/app/cursos/curso-detalhe/curso-detalhe.component.css -------------------------------------------------------------------------------- /rotas/src/app/cursos/curso-detalhe/curso-detalhe.component.html: -------------------------------------------------------------------------------- 1 |

2 | Id: {{ id }} 3 |

4 |

Curso: {{ curso?.nome }}

-------------------------------------------------------------------------------- /rotas/src/app/cursos/curso-form/curso-form.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/rotas/src/app/cursos/curso-form/curso-form.component.css -------------------------------------------------------------------------------- /rotas/src/app/cursos/curso-form/curso-form.component.html: -------------------------------------------------------------------------------- 1 |

2 | curso-form works! 3 |

4 | -------------------------------------------------------------------------------- /rotas/src/app/cursos/curso-form/curso-form.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-curso-form', 5 | templateUrl: './curso-form.component.html', 6 | styleUrls: ['./curso-form.component.css'] 7 | }) 8 | export class CursoFormComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /rotas/src/app/cursos/curso-nao-encontrado/curso-nao-encontrado.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/rotas/src/app/cursos/curso-nao-encontrado/curso-nao-encontrado.component.css -------------------------------------------------------------------------------- /rotas/src/app/cursos/curso-nao-encontrado/curso-nao-encontrado.component.html: -------------------------------------------------------------------------------- 1 |

2 | curso-nao-encontrado works! 3 |

4 | -------------------------------------------------------------------------------- /rotas/src/app/cursos/curso-nao-encontrado/curso-nao-encontrado.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-curso-nao-encontrado', 5 | templateUrl: './curso-nao-encontrado.component.html', 6 | styleUrls: ['./curso-nao-encontrado.component.css'] 7 | }) 8 | export class CursoNaoEncontradoComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /rotas/src/app/cursos/cursos.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/rotas/src/app/cursos/cursos.component.css -------------------------------------------------------------------------------- /rotas/src/app/cursos/cursos.component.html: -------------------------------------------------------------------------------- 1 |

2 | Lista de Cursos 3 |

4 |

Página: {{ pagina }}

5 | 12 | -------------------------------------------------------------------------------- /rotas/src/app/cursos/cursos.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable() 4 | export class CursosService { 5 | 6 | getCursos(){ 7 | return [ 8 | {id: 1, nome: 'Angular 2'}, 9 | {id: 2, nome: 'Java'} 10 | ]; 11 | } 12 | 13 | getCurso(id: number){ 14 | let cursos = this.getCursos(); 15 | for (let i=0; i|boolean { 12 | 13 | console.log('guarda de rota filha'); 14 | 15 | return true; 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /rotas/src/app/guards/iform-candeactivate.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface IFormCanDeactivate { 3 | 4 | podeDesativar(); 5 | } -------------------------------------------------------------------------------- /rotas/src/app/home/home.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/rotas/src/app/home/home.component.css -------------------------------------------------------------------------------- /rotas/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 |

2 | home works! 3 |

4 | -------------------------------------------------------------------------------- /rotas/src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-home', 5 | templateUrl: './home.component.html', 6 | styleUrls: ['./home.component.css'] 7 | }) 8 | export class HomeComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /rotas/src/app/login/login.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/rotas/src/app/login/login.component.css -------------------------------------------------------------------------------- /rotas/src/app/login/login.component.html: -------------------------------------------------------------------------------- 1 |
Login
2 | 3 |
4 |
5 | 6 | 7 |
8 |
9 | 10 |
11 |
12 | 13 | 14 |
15 |
16 | 17 | -------------------------------------------------------------------------------- /rotas/src/app/login/login.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | import { AuthService } from './auth.service'; 4 | import { Usuario } from './usuario'; 5 | 6 | @Component({ 7 | selector: 'app-login', 8 | templateUrl: './login.component.html', 9 | styleUrls: ['./login.component.css'] 10 | }) 11 | export class LoginComponent implements OnInit { 12 | 13 | usuario: Usuario = new Usuario(); 14 | 15 | constructor(private authService: AuthService) { } 16 | 17 | ngOnInit() { 18 | 19 | } 20 | 21 | fazerLogin(){ 22 | //console.log(this.usuario); 23 | this.authService.fazerLogin(this.usuario); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /rotas/src/app/login/usuario.ts: -------------------------------------------------------------------------------- 1 | 2 | export class Usuario { 3 | 4 | nome: string; 5 | senha: string; 6 | } -------------------------------------------------------------------------------- /rotas/src/app/pagina-nao-encontrada/pagina-nao-encontrada.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/rotas/src/app/pagina-nao-encontrada/pagina-nao-encontrada.component.css -------------------------------------------------------------------------------- /rotas/src/app/pagina-nao-encontrada/pagina-nao-encontrada.component.html: -------------------------------------------------------------------------------- 1 |

2 | pagina-nao-encontrada works! 3 |

4 | -------------------------------------------------------------------------------- /rotas/src/app/pagina-nao-encontrada/pagina-nao-encontrada.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-pagina-nao-encontrada', 5 | templateUrl: './pagina-nao-encontrada.component.html', 6 | styleUrls: ['./pagina-nao-encontrada.component.css'] 7 | }) 8 | export class PaginaNaoEncontradaComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /rotas/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/rotas/src/assets/.gitkeep -------------------------------------------------------------------------------- /rotas/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /rotas/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /rotas/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/rotas/src/favicon.ico -------------------------------------------------------------------------------- /rotas/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Rotas 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /rotas/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule); 12 | -------------------------------------------------------------------------------- /rotas/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "baseUrl": "./", 6 | "module": "es2015", 7 | "types": [] 8 | }, 9 | "exclude": [ 10 | "test.ts", 11 | "**/*.spec.ts" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /rotas/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | }, 13 | "files": [ 14 | "test.ts", 15 | "polyfills.ts" 16 | ], 17 | "include": [ 18 | "**/*.spec.ts", 19 | "**/*.d.ts" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /rotas/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /rotas/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "importHelpers": true, 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "target": "es5", 12 | "typeRoots": [ 13 | "node_modules/@types" 14 | ], 15 | "lib": [ 16 | "es2017", 17 | "dom" 18 | ], 19 | "module": "es2015", 20 | "baseUrl": "./" 21 | } 22 | } -------------------------------------------------------------------------------- /servicos/.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # You can see what browsers were selected by your queries by running: 6 | # npx browserslist 7 | 8 | > 0.5% 9 | last 2 versions 10 | Firefox ESR 11 | not dead 12 | not IE 9-11 # For IE 9-11 support, remove 'not'. -------------------------------------------------------------------------------- /servicos/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /servicos/.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 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | testem.log 34 | /typings 35 | 36 | # e2e 37 | /e2e/*.js 38 | /e2e/*.map 39 | 40 | # System Files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /servicos/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('servicos App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /servicos/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /servicos/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "jasminewd2", 11 | "node" 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /servicos/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/servicos/src/app/app.component.css -------------------------------------------------------------------------------- /servicos/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |

3 | -------------------------------------------------------------------------------- /servicos/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | title = 'app works!'; 10 | } 11 | -------------------------------------------------------------------------------- /servicos/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppComponent } from './app.component'; 5 | import { CursosModule } from './cursos/cursos.module'; 6 | import { CursosService } from './cursos/cursos.service'; 7 | import { CriarCursoModule } from './criar-curso/criar-curso.module'; 8 | import { LogService } from './shared/log.service'; 9 | 10 | @NgModule({ 11 | declarations: [ 12 | AppComponent 13 | ], 14 | imports: [ 15 | BrowserModule, 16 | CriarCursoModule, 17 | CursosModule 18 | ], 19 | providers: [LogService], 20 | //providers: [CursosService], 21 | bootstrap: [AppComponent] 22 | }) 23 | export class AppModule { } 24 | -------------------------------------------------------------------------------- /servicos/src/app/criar-curso/criar-curso.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/servicos/src/app/criar-curso/criar-curso.component.css -------------------------------------------------------------------------------- /servicos/src/app/criar-curso/criar-curso.component.html: -------------------------------------------------------------------------------- 1 |
Compartilhando um serviço entre componentes
2 | 3 | 4 | 5 | 6 |
    7 |
  • 8 | {{ curso }} 9 |
  • 10 |
11 | 12 | -------------------------------------------------------------------------------- /servicos/src/app/criar-curso/criar-curso.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | import { CursosService } from '../cursos/cursos.service'; 4 | 5 | @Component({ 6 | selector: 'app-criar-curso', 7 | templateUrl: './criar-curso.component.html', 8 | styleUrls: ['./criar-curso.component.css'], 9 | providers: [CursosService] 10 | }) 11 | export class CriarCursoComponent implements OnInit { 12 | 13 | cursos: string[] = []; 14 | 15 | constructor(private cursosService: CursosService) { } 16 | 17 | ngOnInit() { 18 | this.cursos = this.cursosService.getCursos(); 19 | } 20 | 21 | onAddCurso(curso: string){ 22 | this.cursosService.addCurso(curso); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /servicos/src/app/criar-curso/criar-curso.module.ts: -------------------------------------------------------------------------------- 1 | import { CommonModule } from '@angular/common'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { CursosService } from '../cursos/cursos.service'; 5 | import { CriarCursoComponent } from './criar-curso.component'; 6 | import { ReceberCursoCriadoComponent } from '../receber-curso-criado/receber-curso-criado.component'; 7 | 8 | @NgModule({ 9 | declarations: [ 10 | CriarCursoComponent, 11 | ReceberCursoCriadoComponent 12 | ], 13 | imports: [ 14 | CommonModule 15 | ], 16 | exports: [CriarCursoComponent]//, 17 | //providers: [CursosService] 18 | }) 19 | export class CriarCursoModule { } 20 | -------------------------------------------------------------------------------- /servicos/src/app/cursos/cursos.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/servicos/src/app/cursos/cursos.component.css -------------------------------------------------------------------------------- /servicos/src/app/cursos/cursos.component.html: -------------------------------------------------------------------------------- 1 |
Lista de cursos
2 | 3 |
    4 |
  • 5 | {{ curso }} 6 |
  • 7 |
-------------------------------------------------------------------------------- /servicos/src/app/cursos/cursos.module.ts: -------------------------------------------------------------------------------- 1 | import { CommonModule } from '@angular/common'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { CursosService } from '../cursos/cursos.service'; 5 | import { CursosComponent } from './cursos.component'; 6 | 7 | @NgModule({ 8 | declarations: [ 9 | CursosComponent 10 | ], 11 | imports: [ 12 | CommonModule 13 | ], 14 | exports: [CursosComponent]//, 15 | //providers: [CursosService] 16 | }) 17 | export class CursosModule { } 18 | -------------------------------------------------------------------------------- /servicos/src/app/receber-curso-criado/receber-curso-criado.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/servicos/src/app/receber-curso-criado/receber-curso-criado.component.css -------------------------------------------------------------------------------- /servicos/src/app/receber-curso-criado/receber-curso-criado.component.html: -------------------------------------------------------------------------------- 1 |

2 | O último curso criado foi: {{ curso }} 3 |

4 | -------------------------------------------------------------------------------- /servicos/src/app/receber-curso-criado/receber-curso-criado.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | import { CursosService } from '../cursos/cursos.service'; 4 | 5 | @Component({ 6 | selector: 'app-receber-curso-criado', 7 | templateUrl: './receber-curso-criado.component.html', 8 | styleUrls: ['./receber-curso-criado.component.css'] 9 | }) 10 | export class ReceberCursoCriadoComponent implements OnInit { 11 | 12 | curso: string; 13 | 14 | constructor(private cursosService: CursosService) { } 15 | 16 | ngOnInit() { 17 | this.cursosService.emitirCursoCriado.subscribe( 18 | cursoCriado => this.curso = cursoCriado 19 | ); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /servicos/src/app/shared/log.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable() 4 | export class LogService { 5 | 6 | constructor() { } 7 | 8 | consoleLog(msg: string){ 9 | console.log(msg); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /servicos/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/servicos/src/assets/.gitkeep -------------------------------------------------------------------------------- /servicos/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /servicos/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /servicos/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loiane/curso-angular/8689d26254d7bd6157f831f74df88b2f3a55cacc/servicos/src/favicon.ico -------------------------------------------------------------------------------- /servicos/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Servicos 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /servicos/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule); 12 | -------------------------------------------------------------------------------- /servicos/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /servicos/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "baseUrl": "./", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "main.ts", 10 | "polyfills.ts" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /servicos/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "baseUrl": "./", 6 | "types": [ 7 | "jasmine", 8 | "node" 9 | ] 10 | }, 11 | "files": [ 12 | "test.ts", 13 | "polyfills.ts" 14 | ], 15 | "include": [ 16 | "**/*.spec.ts", 17 | "**/*.d.ts" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /servicos/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /servicos/tsconfig.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "importHelpers": true, 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "target": "es2015", 12 | "typeRoots": [ 13 | "node_modules/@types" 14 | ], 15 | "lib": [ 16 | "es2017", 17 | "dom" 18 | ], 19 | "module": "es2020", 20 | "baseUrl": "./" 21 | } 22 | } -------------------------------------------------------------------------------- /servicos/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* 2 | This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience. 3 | It is not intended to be used to perform a compilation. 4 | 5 | To learn more about this file see: https://angular.io/config/solution-tsconfig. 6 | */ 7 | { 8 | "files": [], 9 | "references": [ 10 | { 11 | "path": "./src/tsconfig.app.json" 12 | }, 13 | { 14 | "path": "./src/tsconfig.spec.json" 15 | } 16 | ] 17 | } --------------------------------------------------------------------------------