├── Components ├── assignment-todo │ ├── ASSIGNMENT.md │ ├── index.html │ ├── script.js │ └── style.css └── components-demo-app │ ├── .editorconfig │ ├── .gitignore │ ├── .vscode │ ├── extensions.json │ ├── launch.json │ └── tasks.json │ ├── README.md │ ├── angular.json │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ └── navigation │ │ │ ├── navigation.component.css │ │ │ ├── navigation.component.html │ │ │ ├── navigation.component.spec.ts │ │ │ └── navigation.component.ts │ ├── assets │ │ └── .gitkeep │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ └── styles.css │ ├── tsconfig.app.json │ ├── tsconfig.json │ └── tsconfig.spec.json ├── DI, Intro to RxJS, Services └── demo-app │ ├── .editorconfig │ ├── .gitignore │ ├── .vscode │ ├── extensions.json │ ├── launch.json │ └── tasks.json │ ├── README.md │ ├── angular.json │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── rxjs-intro.ts │ │ ├── solid-tests.ts │ │ ├── types │ │ │ ├── JsonPlaceholderUser.ts │ │ │ └── User.ts │ │ ├── user-list-item │ │ │ ├── user-list-item.component.css │ │ │ ├── user-list-item.component.html │ │ │ ├── user-list-item.component.spec.ts │ │ │ └── user-list-item.component.ts │ │ ├── user.service.spec.ts │ │ ├── user.service.ts │ │ └── users-list │ │ │ ├── users-list.component.css │ │ │ ├── users-list.component.html │ │ │ ├── users-list.component.spec.ts │ │ │ └── users-list.component.ts │ ├── assets │ │ └── .gitkeep │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ └── styles.css │ ├── tsconfig.app.json │ ├── tsconfig.json │ └── tsconfig.spec.json ├── Directives and Forms └── directives-and-forms │ ├── .editorconfig │ ├── .gitignore │ ├── .vscode │ ├── extensions.json │ ├── launch.json │ └── tasks.json │ ├── README.md │ ├── angular.json │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── highlight-on-move.directive.spec.ts │ │ ├── highlight-on-move.directive.ts │ │ ├── home │ │ │ ├── home.component.css │ │ │ ├── home.component.html │ │ │ ├── home.component.spec.ts │ │ │ └── home.component.ts │ │ ├── login │ │ │ ├── login.component.css │ │ │ ├── login.component.html │ │ │ ├── login.component.spec.ts │ │ │ └── login.component.ts │ │ ├── max-count.directive.spec.ts │ │ ├── max-count.directive.ts │ │ ├── my-router-link.directive.spec.ts │ │ ├── my-router-link.directive.ts │ │ ├── my-structural.directive.spec.ts │ │ ├── my-structural.directive.ts │ │ ├── playground │ │ │ ├── playground.component.css │ │ │ ├── playground.component.html │ │ │ ├── playground.component.spec.ts │ │ │ └── playground.component.ts │ │ └── register │ │ │ ├── register.component.css │ │ │ ├── register.component.html │ │ │ ├── register.component.spec.ts │ │ │ └── register.component.ts │ ├── assets │ │ └── .gitkeep │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ └── styles.css │ ├── tsconfig.app.json │ ├── tsconfig.json │ └── tsconfig.spec.json ├── Intro to Angular and TypeScript ├── AngularDemoApp │ └── my-demo-app │ │ ├── .editorconfig │ │ ├── .gitignore │ │ ├── .vscode │ │ ├── extensions.json │ │ ├── launch.json │ │ └── tasks.json │ │ ├── README.md │ │ ├── angular.json │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── src │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ └── app.module.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ └── styles.css │ │ ├── tsconfig.app.json │ │ ├── tsconfig.json │ │ └── tsconfig.spec.json ├── MPA │ ├── about.html │ ├── contacts.html │ └── index.html ├── TypeScriptTraining │ ├── playground.js │ ├── playground.ts │ ├── test.js │ └── test.ts ├── Untitled Diagram.drawio └── resources.md ├── Modules and Routing └── modules-and-routing │ ├── .editorconfig │ ├── .gitignore │ ├── .vscode │ ├── extensions.json │ ├── launch.json │ └── tasks.json │ ├── README.md │ ├── angular.json │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── core │ │ │ ├── core.module.ts │ │ │ ├── global-loader │ │ │ │ ├── global-loader.component.css │ │ │ │ ├── global-loader.component.html │ │ │ │ ├── global-loader.component.spec.ts │ │ │ │ ├── global-loader.component.ts │ │ │ │ ├── global-loader.service.spec.ts │ │ │ │ └── global-loader.service.ts │ │ │ └── navigation │ │ │ │ ├── navigation.component.css │ │ │ │ ├── navigation.component.html │ │ │ │ ├── navigation.component.spec.ts │ │ │ │ └── navigation.component.ts │ │ ├── shared │ │ │ ├── shared.module.ts │ │ │ └── spinner │ │ │ │ ├── spinner.component.css │ │ │ │ ├── spinner.component.html │ │ │ │ ├── spinner.component.spec.ts │ │ │ │ └── spinner.component.ts │ │ ├── todo │ │ │ ├── todo-list │ │ │ │ ├── todo-list.component.css │ │ │ │ ├── todo-list.component.html │ │ │ │ ├── todo-list.component.spec.ts │ │ │ │ └── todo-list.component.ts │ │ │ └── todo.module.ts │ │ ├── types │ │ │ └── User.ts │ │ └── user │ │ │ ├── user-detail │ │ │ ├── user-detail.component.css │ │ │ ├── user-detail.component.html │ │ │ ├── user-detail.component.spec.ts │ │ │ ├── user-detail.component.ts │ │ │ ├── user-detail.guard.ts │ │ │ └── user-detail.resolver.ts │ │ │ ├── user-list │ │ │ ├── user-list.component.css │ │ │ ├── user-list.component.html │ │ │ ├── user-list.component.spec.ts │ │ │ └── user-list.component.ts │ │ │ ├── user.module.ts │ │ │ ├── user.service.spec.ts │ │ │ └── user.service.ts │ ├── assets │ │ └── .gitkeep │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ └── styles.css │ ├── tsconfig.app.json │ ├── tsconfig.json │ └── tsconfig.spec.json ├── Q&A └── q-and-a-app │ ├── .editorconfig │ ├── .gitignore │ ├── .vscode │ ├── extensions.json │ ├── launch.json │ └── tasks.json │ ├── README.md │ ├── angular.json │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── popup.service.spec.ts │ │ ├── popup.service.ts │ │ ├── store │ │ │ ├── action.ts │ │ │ ├── index.ts │ │ │ └── selector.ts │ │ └── your │ │ │ ├── your.component.css │ │ │ ├── your.component.html │ │ │ ├── your.component.spec.ts │ │ │ └── your.component.ts │ ├── assets │ │ └── .gitkeep │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ └── styles.css │ ├── tsconfig.app.json │ ├── tsconfig.json │ └── tsconfig.spec.json ├── README.md ├── Workshop Components ├── Rest-api │ ├── .gitattributes │ ├── .gitignore │ ├── .vscode │ │ └── launch.json │ ├── app-config.js │ ├── config │ │ ├── config.js │ │ ├── db.js │ │ └── express.js │ ├── controllers │ │ ├── auth.js │ │ ├── index.js │ │ ├── postController.js │ │ └── themeController.js │ ├── index.js │ ├── models │ │ ├── index.js │ │ ├── postModel.js │ │ ├── themeModel.js │ │ ├── tokenBlacklistModel.js │ │ └── userModel.js │ ├── package-lock.json │ ├── package.json │ ├── readme.md │ ├── router │ │ ├── index.js │ │ ├── likes.js │ │ ├── posts.js │ │ ├── test.js │ │ ├── themes.js │ │ └── users.js │ └── utils │ │ ├── auth.js │ │ ├── errHandler.js │ │ ├── index.js │ │ └── jwt.js ├── components-workshop │ ├── .editorconfig │ ├── .gitignore │ ├── .vscode │ │ ├── extensions.json │ │ ├── launch.json │ │ └── tasks.json │ ├── README.md │ ├── angular.json │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── app │ │ │ ├── api.service.spec.ts │ │ │ ├── api.service.ts │ │ │ ├── app-routing.module.ts │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ ├── core │ │ │ │ ├── core.module.ts │ │ │ │ ├── footer │ │ │ │ │ ├── footer.component.css │ │ │ │ │ ├── footer.component.html │ │ │ │ │ ├── footer.component.spec.ts │ │ │ │ │ └── footer.component.ts │ │ │ │ └── header │ │ │ │ │ ├── header.component.css │ │ │ │ │ ├── header.component.html │ │ │ │ │ ├── header.component.spec.ts │ │ │ │ │ └── header.component.ts │ │ │ ├── main │ │ │ │ ├── main.component.css │ │ │ │ ├── main.component.html │ │ │ │ ├── main.component.spec.ts │ │ │ │ └── main.component.ts │ │ │ ├── posts-list │ │ │ │ ├── posts-list.component.css │ │ │ │ ├── posts-list.component.html │ │ │ │ ├── posts-list.component.spec.ts │ │ │ │ └── posts-list.component.ts │ │ │ ├── shared │ │ │ │ ├── loader │ │ │ │ │ ├── loader.component.css │ │ │ │ │ ├── loader.component.html │ │ │ │ │ ├── loader.component.spec.ts │ │ │ │ │ └── loader.component.ts │ │ │ │ └── shared.module.ts │ │ │ ├── themes-list │ │ │ │ ├── themes-list.component.css │ │ │ │ ├── themes-list.component.html │ │ │ │ ├── themes-list.component.spec.ts │ │ │ │ └── themes-list.component.ts │ │ │ └── types │ │ │ │ ├── post.ts │ │ │ │ ├── theme.ts │ │ │ │ └── user-id.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── environments │ │ │ ├── environment.development.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ └── styles.css │ ├── tsconfig.app.json │ ├── tsconfig.json │ └── tsconfig.spec.json └── resources │ ├── forum │ ├── posts.bson │ ├── posts.metadata.json │ ├── themes.bson │ ├── themes.metadata.json │ ├── users.bson │ └── users.metadata.json │ └── views │ ├── index.html │ ├── layout.css │ ├── reset.css │ ├── responsive.css │ ├── style.css │ └── typography.css ├── Workshop Forms └── workshop-forms │ ├── .editorconfig │ ├── .gitignore │ ├── .vscode │ ├── extensions.json │ ├── launch.json │ └── tasks.json │ ├── README.md │ ├── angular.json │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app │ │ ├── api.service.spec.ts │ │ ├── api.service.ts │ │ ├── app-routing.module.ts │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── core │ │ │ ├── core.module.ts │ │ │ ├── footer │ │ │ │ ├── footer.component.css │ │ │ │ ├── footer.component.html │ │ │ │ ├── footer.component.spec.ts │ │ │ │ └── footer.component.ts │ │ │ ├── guards │ │ │ │ └── auth.activate.ts │ │ │ └── header │ │ │ │ ├── header.component.css │ │ │ │ ├── header.component.html │ │ │ │ ├── header.component.spec.ts │ │ │ │ └── header.component.ts │ │ ├── home │ │ │ ├── home.component.css │ │ │ ├── home.component.html │ │ │ ├── home.component.spec.ts │ │ │ └── home.component.ts │ │ ├── main │ │ │ ├── main.component.css │ │ │ ├── main.component.html │ │ │ ├── main.component.spec.ts │ │ │ └── main.component.ts │ │ ├── not-found │ │ │ ├── not-found.component.css │ │ │ ├── not-found.component.html │ │ │ ├── not-found.component.spec.ts │ │ │ └── not-found.component.ts │ │ ├── posts-list │ │ │ ├── posts-list.component.css │ │ │ ├── posts-list.component.html │ │ │ ├── posts-list.component.spec.ts │ │ │ └── posts-list.component.ts │ │ ├── shared │ │ │ ├── constants.ts │ │ │ ├── loader │ │ │ │ ├── loader.component.css │ │ │ │ ├── loader.component.html │ │ │ │ ├── loader.component.spec.ts │ │ │ │ └── loader.component.ts │ │ │ ├── shared.module.ts │ │ │ └── validators │ │ │ │ ├── app-email-validator.ts │ │ │ │ ├── app-email.directive.spec.ts │ │ │ │ ├── app-email.directive.ts │ │ │ │ └── match-passwords-validator.ts │ │ ├── theme │ │ │ ├── current-theme │ │ │ │ ├── current-theme.component.css │ │ │ │ ├── current-theme.component.html │ │ │ │ ├── current-theme.component.spec.ts │ │ │ │ └── current-theme.component.ts │ │ │ ├── new-theme │ │ │ │ ├── new-theme.component.css │ │ │ │ ├── new-theme.component.html │ │ │ │ ├── new-theme.component.spec.ts │ │ │ │ └── new-theme.component.ts │ │ │ ├── theme-routing.module.ts │ │ │ └── theme.module.ts │ │ ├── themes-list │ │ │ ├── themes-list.component.css │ │ │ ├── themes-list.component.html │ │ │ ├── themes-list.component.spec.ts │ │ │ └── themes-list.component.ts │ │ ├── types │ │ │ ├── post.ts │ │ │ ├── theme.ts │ │ │ ├── user-id.ts │ │ │ └── user.ts │ │ ├── user │ │ │ ├── login │ │ │ │ ├── login.component.css │ │ │ │ ├── login.component.html │ │ │ │ ├── login.component.spec.ts │ │ │ │ └── login.component.ts │ │ │ ├── profile │ │ │ │ ├── profile.component.css │ │ │ │ ├── profile.component.html │ │ │ │ ├── profile.component.spec.ts │ │ │ │ └── profile.component.ts │ │ │ ├── register │ │ │ │ ├── register.component.css │ │ │ │ ├── register.component.html │ │ │ │ ├── register.component.spec.ts │ │ │ │ └── register.component.ts │ │ │ ├── user-routing.module.ts │ │ │ ├── user.module.ts │ │ │ ├── user.service.spec.ts │ │ │ └── user.service.ts │ │ └── welcome │ │ │ ├── welcome.component.css │ │ │ ├── welcome.component.html │ │ │ ├── welcome.component.spec.ts │ │ │ └── welcome.component.ts │ ├── assets │ │ ├── .gitkeep │ │ └── profile.png │ ├── environments │ │ ├── environment.development.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ └── styles.css │ ├── tsconfig.app.json │ ├── tsconfig.json │ └── tsconfig.spec.json ├── Workshop Modules and Routing ├── Rest-api │ ├── .gitattributes │ ├── .gitignore │ ├── .vscode │ │ └── launch.json │ ├── app-config.js │ ├── config │ │ ├── config.js │ │ ├── db.js │ │ └── express.js │ ├── controllers │ │ ├── auth.js │ │ ├── index.js │ │ ├── postController.js │ │ └── themeController.js │ ├── index.js │ ├── models │ │ ├── index.js │ │ ├── postModel.js │ │ ├── themeModel.js │ │ ├── tokenBlacklistModel.js │ │ └── userModel.js │ ├── package-lock.json │ ├── package.json │ ├── readme.md │ ├── router │ │ ├── index.js │ │ ├── likes.js │ │ ├── posts.js │ │ ├── test.js │ │ ├── themes.js │ │ └── users.js │ └── utils │ │ ├── auth.js │ │ ├── errHandler.js │ │ ├── index.js │ │ └── jwt.js ├── modules-and-routing-workshop │ ├── .editorconfig │ ├── .gitignore │ ├── .vscode │ │ ├── extensions.json │ │ ├── launch.json │ │ └── tasks.json │ ├── ASSIGNMENT.md │ ├── README.md │ ├── angular.json │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── app │ │ │ ├── api.service.spec.ts │ │ │ ├── api.service.ts │ │ │ ├── app-routing.module.ts │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ ├── core │ │ │ │ ├── core.module.ts │ │ │ │ ├── footer │ │ │ │ │ ├── footer.component.css │ │ │ │ │ ├── footer.component.html │ │ │ │ │ ├── footer.component.spec.ts │ │ │ │ │ └── footer.component.ts │ │ │ │ ├── guards │ │ │ │ │ └── auth.activate.ts │ │ │ │ └── header │ │ │ │ │ ├── header.component.css │ │ │ │ │ ├── header.component.html │ │ │ │ │ ├── header.component.spec.ts │ │ │ │ │ └── header.component.ts │ │ │ ├── home │ │ │ │ ├── home.component.css │ │ │ │ ├── home.component.html │ │ │ │ ├── home.component.spec.ts │ │ │ │ └── home.component.ts │ │ │ ├── main │ │ │ │ ├── main.component.css │ │ │ │ ├── main.component.html │ │ │ │ ├── main.component.spec.ts │ │ │ │ └── main.component.ts │ │ │ ├── not-found │ │ │ │ ├── not-found.component.css │ │ │ │ ├── not-found.component.html │ │ │ │ ├── not-found.component.spec.ts │ │ │ │ └── not-found.component.ts │ │ │ ├── posts-list │ │ │ │ ├── posts-list.component.css │ │ │ │ ├── posts-list.component.html │ │ │ │ ├── posts-list.component.spec.ts │ │ │ │ └── posts-list.component.ts │ │ │ ├── shared │ │ │ │ ├── loader │ │ │ │ │ ├── loader.component.css │ │ │ │ │ ├── loader.component.html │ │ │ │ │ ├── loader.component.spec.ts │ │ │ │ │ └── loader.component.ts │ │ │ │ └── shared.module.ts │ │ │ ├── theme │ │ │ │ ├── current-theme │ │ │ │ │ ├── current-theme.component.css │ │ │ │ │ ├── current-theme.component.html │ │ │ │ │ ├── current-theme.component.spec.ts │ │ │ │ │ └── current-theme.component.ts │ │ │ │ ├── new-theme │ │ │ │ │ ├── new-theme.component.css │ │ │ │ │ ├── new-theme.component.html │ │ │ │ │ ├── new-theme.component.spec.ts │ │ │ │ │ └── new-theme.component.ts │ │ │ │ ├── theme-routing.module.ts │ │ │ │ └── theme.module.ts │ │ │ ├── themes-list │ │ │ │ ├── themes-list.component.css │ │ │ │ ├── themes-list.component.html │ │ │ │ ├── themes-list.component.spec.ts │ │ │ │ └── themes-list.component.ts │ │ │ ├── types │ │ │ │ ├── post.ts │ │ │ │ ├── theme.ts │ │ │ │ ├── user-id.ts │ │ │ │ └── user.ts │ │ │ ├── user │ │ │ │ ├── login │ │ │ │ │ ├── login.component.css │ │ │ │ │ ├── login.component.html │ │ │ │ │ ├── login.component.spec.ts │ │ │ │ │ └── login.component.ts │ │ │ │ ├── profile │ │ │ │ │ ├── profile.component.css │ │ │ │ │ ├── profile.component.html │ │ │ │ │ ├── profile.component.spec.ts │ │ │ │ │ └── profile.component.ts │ │ │ │ ├── register │ │ │ │ │ ├── register.component.css │ │ │ │ │ ├── register.component.html │ │ │ │ │ ├── register.component.spec.ts │ │ │ │ │ └── register.component.ts │ │ │ │ ├── user-routing.module.ts │ │ │ │ ├── user.module.ts │ │ │ │ ├── user.service.spec.ts │ │ │ │ └── user.service.ts │ │ │ └── welcome │ │ │ │ ├── welcome.component.css │ │ │ │ ├── welcome.component.html │ │ │ │ ├── welcome.component.spec.ts │ │ │ │ └── welcome.component.ts │ │ ├── assets │ │ │ ├── .gitkeep │ │ │ └── profile.png │ │ ├── environments │ │ │ ├── environment.development.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ └── styles.css │ ├── tsconfig.app.json │ ├── tsconfig.json │ └── tsconfig.spec.json └── resources │ ├── forum │ ├── posts.bson │ ├── posts.metadata.json │ ├── themes.bson │ ├── themes.metadata.json │ ├── users.bson │ └── users.metadata.json │ └── views │ ├── 404-not-found │ ├── 404.css │ └── 404.html │ ├── home │ ├── home.css │ └── home.html │ ├── login │ ├── login.css │ └── login.html │ ├── new-theme │ ├── new-theme.css │ └── new-theme.html │ ├── profile │ ├── profile.css │ └── profile.html │ ├── register │ ├── register.css │ └── register.html │ └── theme-content │ ├── layout.css │ ├── profile.png │ ├── reset.css │ ├── responsive.css │ ├── style.css │ ├── theme-content.css │ ├── theme-content.html │ └── typography.css ├── firebase-guide-setup.docx ├── ngrx └── ngrx-test-app │ ├── .editorconfig │ ├── .gitignore │ ├── .vscode │ ├── extensions.json │ ├── launch.json │ └── tasks.json │ ├── README.md │ ├── angular.json │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── post │ │ │ ├── post.actions.ts │ │ │ ├── post.component.css │ │ │ ├── post.component.html │ │ │ ├── post.component.spec.ts │ │ │ ├── post.component.ts │ │ │ ├── post.reducer.ts │ │ │ └── post.type.ts │ │ ├── redux-simulation │ │ │ ├── redux-simulation.component.css │ │ │ ├── redux-simulation.component.html │ │ │ ├── redux-simulation.component.spec.ts │ │ │ └── redux-simulation.component.ts │ │ └── translate │ │ │ ├── translate.component.css │ │ │ ├── translate.component.html │ │ │ ├── translate.component.spec.ts │ │ │ ├── translate.component.ts │ │ │ ├── translate.reducer.ts │ │ │ └── translate.type.ts │ ├── assets │ │ └── .gitkeep │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ └── styles.css │ ├── tsconfig.app.json │ ├── tsconfig.json │ └── tsconfig.spec.json ├── pipes and subjects └── pipes-and-subjects │ ├── .editorconfig │ ├── .gitignore │ ├── .vscode │ ├── extensions.json │ ├── launch.json │ └── tasks.json │ ├── README.md │ ├── angular.json │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.spec.ts │ │ ├── app.component.ts │ │ ├── app.interceptor.ts │ │ ├── app.module.ts │ │ ├── constants.ts │ │ ├── home │ │ │ ├── home.component.css │ │ │ ├── home.component.html │ │ │ ├── home.component.spec.ts │ │ │ └── home.component.ts │ │ ├── lazy │ │ │ ├── lazy.module.ts │ │ │ ├── lazy.router.ts │ │ │ └── lazy │ │ │ │ ├── lazy.component.css │ │ │ │ ├── lazy.component.html │ │ │ │ ├── lazy.component.spec.ts │ │ │ │ └── lazy.component.ts │ │ ├── reduce.pipe.spec.ts │ │ ├── reduce.pipe.ts │ │ ├── user.service.spec.ts │ │ └── user.service.ts │ ├── assets │ │ └── .gitkeep │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ └── styles.css │ ├── tsconfig.app.json │ ├── tsconfig.json │ └── tsconfig.spec.json └── workshop pipes and subjects └── workshop-pipes ├── .editorconfig ├── .gitignore ├── .vscode ├── extensions.json ├── launch.json └── tasks.json ├── README.md ├── angular.json ├── package-lock.json ├── package.json ├── src ├── app │ ├── api.service.spec.ts │ ├── api.service.ts │ ├── app-routing.module.ts │ ├── app.component.css │ ├── app.component.html │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.interceptor.ts │ ├── app.module.ts │ ├── authenticate │ │ ├── authenticate.component.css │ │ ├── authenticate.component.html │ │ ├── authenticate.component.spec.ts │ │ └── authenticate.component.ts │ ├── core │ │ ├── core.module.ts │ │ ├── error │ │ │ ├── error.component.css │ │ │ ├── error.component.html │ │ │ ├── error.component.spec.ts │ │ │ ├── error.component.ts │ │ │ ├── error.service.spec.ts │ │ │ └── error.service.ts │ │ ├── footer │ │ │ ├── footer.component.css │ │ │ ├── footer.component.html │ │ │ ├── footer.component.spec.ts │ │ │ └── footer.component.ts │ │ ├── guards │ │ │ └── auth.activate.ts │ │ └── header │ │ │ ├── header.component.css │ │ │ ├── header.component.html │ │ │ ├── header.component.spec.ts │ │ │ └── header.component.ts │ ├── home │ │ ├── home.component.css │ │ ├── home.component.html │ │ ├── home.component.spec.ts │ │ └── home.component.ts │ ├── main │ │ ├── main.component.css │ │ ├── main.component.html │ │ ├── main.component.spec.ts │ │ └── main.component.ts │ ├── not-found │ │ ├── not-found.component.css │ │ ├── not-found.component.html │ │ ├── not-found.component.spec.ts │ │ └── not-found.component.ts │ ├── posts-list │ │ ├── posts-list.component.css │ │ ├── posts-list.component.html │ │ ├── posts-list.component.spec.ts │ │ └── posts-list.component.ts │ ├── shared │ │ ├── constants.ts │ │ ├── loader │ │ │ ├── loader.component.css │ │ │ ├── loader.component.html │ │ │ ├── loader.component.spec.ts │ │ │ └── loader.component.ts │ │ ├── pipes │ │ │ ├── elapsed-time.pipe.spec.ts │ │ │ ├── elapsed-time.pipe.ts │ │ │ ├── slice.pipe.spec.ts │ │ │ └── slice.pipe.ts │ │ ├── shared.module.ts │ │ └── validators │ │ │ ├── app-email-validator.ts │ │ │ ├── app-email.directive.spec.ts │ │ │ ├── app-email.directive.ts │ │ │ └── match-passwords-validator.ts │ ├── theme │ │ ├── current-theme │ │ │ ├── current-theme.component.css │ │ │ ├── current-theme.component.html │ │ │ ├── current-theme.component.spec.ts │ │ │ └── current-theme.component.ts │ │ ├── new-theme │ │ │ ├── new-theme.component.css │ │ │ ├── new-theme.component.html │ │ │ ├── new-theme.component.spec.ts │ │ │ └── new-theme.component.ts │ │ ├── theme-routing.module.ts │ │ └── theme.module.ts │ ├── themes-list │ │ ├── themes-list.component.css │ │ ├── themes-list.component.html │ │ ├── themes-list.component.spec.ts │ │ └── themes-list.component.ts │ ├── types │ │ ├── post.ts │ │ ├── theme.ts │ │ ├── user-id.ts │ │ └── user.ts │ ├── user │ │ ├── login │ │ │ ├── login.component.css │ │ │ ├── login.component.html │ │ │ ├── login.component.spec.ts │ │ │ └── login.component.ts │ │ ├── profile │ │ │ ├── profile.component.css │ │ │ ├── profile.component.html │ │ │ ├── profile.component.spec.ts │ │ │ └── profile.component.ts │ │ ├── register │ │ │ ├── register.component.css │ │ │ ├── register.component.html │ │ │ ├── register.component.spec.ts │ │ │ └── register.component.ts │ │ ├── user-routing.module.ts │ │ ├── user.module.ts │ │ ├── user.service.spec.ts │ │ └── user.service.ts │ └── welcome │ │ ├── welcome.component.css │ │ ├── welcome.component.html │ │ ├── welcome.component.spec.ts │ │ └── welcome.component.ts ├── assets │ ├── .gitkeep │ └── profile.png ├── environments │ ├── environment.development.ts │ └── environment.ts ├── favicon.ico ├── index.html ├── main.ts └── styles.css ├── tsconfig.app.json ├── tsconfig.json └── tsconfig.spec.json /Components/assignment-todo/ASSIGNMENT.md: -------------------------------------------------------------------------------- 1 | Conver HTML, CSS and JavaScript project into Angular project. Use components, directives and everything you know for Angular until now. 2 | 3 | "assignment-todo" is the project ot use as starting point! 4 | -------------------------------------------------------------------------------- /Components/components-demo-app/.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 | -------------------------------------------------------------------------------- /Components/components-demo-app/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /Components/components-demo-app/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://localhost:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://localhost:9876/debug.html" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /Components/components-demo-app/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Components/components-demo-app/src/app/app.component.css -------------------------------------------------------------------------------- /Components/components-demo-app/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /Components/components-demo-app/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 = 'title from AppComponent'; 10 | 11 | users = [ 12 | { name: 'Mitko', age: true }, 13 | { name: 'Pesho', age: true }, 14 | { name: 'Mariika', age: false }, 15 | { name: 'Katya', age: true }, 16 | ]; 17 | 18 | outputChildHandler() { 19 | console.log('outputChildHandler'); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Components/components-demo-app/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | 4 | import { AppComponent } from './app.component'; 5 | import { NavigationComponent } from './navigation/navigation.component'; 6 | 7 | @NgModule({ 8 | declarations: [AppComponent, NavigationComponent], 9 | imports: [BrowserModule], 10 | providers: [], 11 | bootstrap: [AppComponent], 12 | }) 13 | export class AppModule {} 14 | -------------------------------------------------------------------------------- /Components/components-demo-app/src/app/navigation/navigation.component.css: -------------------------------------------------------------------------------- 1 | #nav { 2 | width: 100%; 3 | height: 80px; 4 | background-color: chocolate; 5 | padding: 20px; 6 | display: flex; 7 | justify-content: space-evenly; 8 | align-items: center; 9 | flex-direction: row; 10 | } 11 | 12 | .green { 13 | color: green; 14 | } 15 | 16 | .red { 17 | color: red; 18 | } 19 | -------------------------------------------------------------------------------- /Components/components-demo-app/src/app/navigation/navigation.component.html: -------------------------------------------------------------------------------- 1 | 24 | -------------------------------------------------------------------------------- /Components/components-demo-app/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Components/components-demo-app/src/assets/.gitkeep -------------------------------------------------------------------------------- /Components/components-demo-app/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Components/components-demo-app/src/favicon.ico -------------------------------------------------------------------------------- /Components/components-demo-app/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ComponentsDemoApp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Components/components-demo-app/src/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app/app.module'; 4 | 5 | 6 | platformBrowserDynamic().bootstrapModule(AppModule) 7 | .catch(err => console.error(err)); 8 | -------------------------------------------------------------------------------- /Components/components-demo-app/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /Components/components-demo-app/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 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /Components/components-demo-app/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 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /DI, Intro to RxJS, Services/demo-app/.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 | -------------------------------------------------------------------------------- /DI, Intro to RxJS, Services/demo-app/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /DI, Intro to RxJS, Services/demo-app/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://localhost:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://localhost:9876/debug.html" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /DI, Intro to RxJS, Services/demo-app/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | 4 | const routes: Routes = []; 5 | 6 | @NgModule({ 7 | imports: [RouterModule.forRoot(routes)], 8 | exports: [RouterModule] 9 | }) 10 | export class AppRoutingModule { } 11 | -------------------------------------------------------------------------------- /DI, Intro to RxJS, Services/demo-app/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/DI, Intro to RxJS, Services/demo-app/src/app/app.component.css -------------------------------------------------------------------------------- /DI, Intro to RxJS, Services/demo-app/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

{{ title }} works!

2 | 3 |
4 | 5 | 6 | 7 |
8 | 9 |
10 |

Loading...

11 |
12 | 13 |
14 | 15 |
16 | -------------------------------------------------------------------------------- /DI, Intro to RxJS, Services/demo-app/src/app/types/JsonPlaceholderUser.ts: -------------------------------------------------------------------------------- 1 | interface Company { 2 | name: string; 3 | catchPhrase: string; 4 | bs: string; 5 | } 6 | 7 | interface Geo { 8 | lat: string; 9 | lng: string; 10 | } 11 | 12 | interface Address { 13 | street: string; 14 | suite: string; 15 | city: string; 16 | zipcode: string; 17 | geo: Geolocation; 18 | } 19 | 20 | export interface User { 21 | id: number; 22 | name: string; 23 | username: string; 24 | email: string; 25 | address: Address; 26 | phone: string; 27 | website: string; 28 | company: Company; 29 | } 30 | -------------------------------------------------------------------------------- /DI, Intro to RxJS, Services/demo-app/src/app/types/User.ts: -------------------------------------------------------------------------------- 1 | export interface User { 2 | name: string; 3 | age: number; 4 | } 5 | -------------------------------------------------------------------------------- /DI, Intro to RxJS, Services/demo-app/src/app/user-list-item/user-list-item.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/DI, Intro to RxJS, Services/demo-app/src/app/user-list-item/user-list-item.component.css -------------------------------------------------------------------------------- /DI, Intro to RxJS, Services/demo-app/src/app/user-list-item/user-list-item.component.html: -------------------------------------------------------------------------------- 1 |

My name is {{ user?.name }} and my email is {{ user?.email }}.

2 | -------------------------------------------------------------------------------- /DI, Intro to RxJS, Services/demo-app/src/app/user-list-item/user-list-item.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | import { User } from '../types/JsonPlaceholderUser'; 3 | 4 | @Component({ 5 | selector: 'app-user-list-item', 6 | templateUrl: './user-list-item.component.html', 7 | styleUrls: ['./user-list-item.component.css'], 8 | }) 9 | export class UserListItemComponent { 10 | @Input() user: User | undefined = undefined; 11 | } 12 | -------------------------------------------------------------------------------- /DI, Intro to RxJS, Services/demo-app/src/app/user.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { UserService } from './user.service'; 4 | 5 | describe('UserService', () => { 6 | let service: UserService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(UserService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /DI, Intro to RxJS, Services/demo-app/src/app/users-list/users-list.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/DI, Intro to RxJS, Services/demo-app/src/app/users-list/users-list.component.css -------------------------------------------------------------------------------- /DI, Intro to RxJS, Services/demo-app/src/app/users-list/users-list.component.html: -------------------------------------------------------------------------------- 1 |
2 | 5 | 10 |
11 | -------------------------------------------------------------------------------- /DI, Intro to RxJS, Services/demo-app/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/DI, Intro to RxJS, Services/demo-app/src/assets/.gitkeep -------------------------------------------------------------------------------- /DI, Intro to RxJS, Services/demo-app/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/DI, Intro to RxJS, Services/demo-app/src/favicon.ico -------------------------------------------------------------------------------- /DI, Intro to RxJS, Services/demo-app/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | DemoApp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /DI, Intro to RxJS, Services/demo-app/src/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app/app.module'; 4 | 5 | 6 | platformBrowserDynamic().bootstrapModule(AppModule) 7 | .catch(err => console.error(err)); 8 | -------------------------------------------------------------------------------- /DI, Intro to RxJS, Services/demo-app/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /DI, Intro to RxJS, Services/demo-app/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 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /DI, Intro to RxJS, Services/demo-app/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 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/.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 | -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://localhost:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://localhost:9876/debug.html" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Directives and Forms/directives-and-forms/src/app/app.component.css -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 5 |
6 | 7 | -------------------------------------------------------------------------------- /Directives and Forms/directives-and-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 | -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/src/app/highlight-on-move.directive.spec.ts: -------------------------------------------------------------------------------- 1 | import { HighlightOnMoveDirective } from './highlight-on-move.directive'; 2 | 3 | describe('HighlightOnMoveDirective', () => { 4 | it('should create an instance', () => { 5 | const directive = new HighlightOnMoveDirective(); 6 | expect(directive).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/src/app/home/home.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Directives and Forms/directives-and-forms/src/app/home/home.component.css -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 |

home works!

2 | -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HomeComponent } from './home.component'; 4 | 5 | describe('HomeComponent', () => { 6 | let component: HomeComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [HomeComponent] 12 | }); 13 | fixture = TestBed.createComponent(HomeComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } 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 { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/src/app/login/login.component.css: -------------------------------------------------------------------------------- 1 | .highlight { 2 | color: orangered; 3 | background-color: rgb(212, 199, 82); 4 | font-size: 20px; 5 | cursor: pointer; 6 | } 7 | -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/src/app/login/login.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LoginComponent } from './login.component'; 4 | 5 | describe('LoginComponent', () => { 6 | let component: LoginComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [LoginComponent] 12 | }); 13 | fixture = TestBed.createComponent(LoginComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/src/app/max-count.directive.spec.ts: -------------------------------------------------------------------------------- 1 | import { MaxCountDirective } from './max-count.directive'; 2 | 3 | describe('MaxCountDirective', () => { 4 | it('should create an instance', () => { 5 | const directive = new MaxCountDirective(); 6 | expect(directive).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/src/app/my-router-link.directive.spec.ts: -------------------------------------------------------------------------------- 1 | import { MyRouterLinkDirective } from './my-router-link.directive'; 2 | 3 | describe('MyRouterLinkDirective', () => { 4 | it('should create an instance', () => { 5 | const directive = new MyRouterLinkDirective(); 6 | expect(directive).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/src/app/my-structural.directive.spec.ts: -------------------------------------------------------------------------------- 1 | import { MyStructuralDirective } from './my-structural.directive'; 2 | 3 | describe('MyStructuralDirective', () => { 4 | it('should create an instance', () => { 5 | const directive = new MyStructuralDirective(); 6 | expect(directive).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/src/app/playground/playground.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Directives and Forms/directives-and-forms/src/app/playground/playground.component.css -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/src/app/playground/playground.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-playground', 5 | templateUrl: './playground.component.html', 6 | styleUrls: ['./playground.component.css'], 7 | }) 8 | export class PlaygroundComponent { 9 | isShown: boolean = true; 10 | 11 | toggle(): void { 12 | this.isShown = !this.isShown; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/src/app/register/register.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Directives and Forms/directives-and-forms/src/app/register/register.component.css -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Directives and Forms/directives-and-forms/src/assets/.gitkeep -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Directives and Forms/directives-and-forms/src/favicon.ico -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | DirectivesAndForms 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/src/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app/app.module'; 4 | 5 | 6 | platformBrowserDynamic().bootstrapModule(AppModule) 7 | .catch(err => console.error(err)); 8 | -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/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 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /Directives and Forms/directives-and-forms/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 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /Intro to Angular and TypeScript/AngularDemoApp/my-demo-app/.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 | -------------------------------------------------------------------------------- /Intro to Angular and TypeScript/AngularDemoApp/my-demo-app/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /Intro to Angular and TypeScript/AngularDemoApp/my-demo-app/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://localhost:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://localhost:9876/debug.html" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /Intro to Angular and TypeScript/AngularDemoApp/my-demo-app/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Intro to Angular and TypeScript/AngularDemoApp/my-demo-app/src/app/app.component.css -------------------------------------------------------------------------------- /Intro to Angular and TypeScript/AngularDemoApp/my-demo-app/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | {{ title }} {{ num }} 2 | -------------------------------------------------------------------------------- /Intro to Angular and TypeScript/AngularDemoApp/my-demo-app/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 = 'SOFTUNI TEST'; 10 | num = 44; 11 | } 12 | -------------------------------------------------------------------------------- /Intro to Angular and TypeScript/AngularDemoApp/my-demo-app/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | 4 | import { AppComponent } from './app.component'; 5 | 6 | @NgModule({ 7 | declarations: [ 8 | AppComponent 9 | ], 10 | imports: [ 11 | BrowserModule 12 | ], 13 | providers: [], 14 | bootstrap: [AppComponent] 15 | }) 16 | export class AppModule { } 17 | -------------------------------------------------------------------------------- /Intro to Angular and TypeScript/AngularDemoApp/my-demo-app/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Intro to Angular and TypeScript/AngularDemoApp/my-demo-app/src/assets/.gitkeep -------------------------------------------------------------------------------- /Intro to Angular and TypeScript/AngularDemoApp/my-demo-app/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Intro to Angular and TypeScript/AngularDemoApp/my-demo-app/src/favicon.ico -------------------------------------------------------------------------------- /Intro to Angular and TypeScript/AngularDemoApp/my-demo-app/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | MyDemoApp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Intro to Angular and TypeScript/AngularDemoApp/my-demo-app/src/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app/app.module'; 4 | 5 | 6 | platformBrowserDynamic().bootstrapModule(AppModule) 7 | .catch(err => console.error(err)); 8 | -------------------------------------------------------------------------------- /Intro to Angular and TypeScript/AngularDemoApp/my-demo-app/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /Intro to Angular and TypeScript/AngularDemoApp/my-demo-app/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 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /Intro to Angular and TypeScript/AngularDemoApp/my-demo-app/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 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /Intro to Angular and TypeScript/MPA/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | About 7 | 8 | 9 | back to Home 10 | 11 | 12 | -------------------------------------------------------------------------------- /Intro to Angular and TypeScript/MPA/contacts.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Contacts 7 | 8 | 9 | back to Home 10 | 11 | 12 | -------------------------------------------------------------------------------- /Intro to Angular and TypeScript/MPA/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Home 7 | 8 | 9 |

Welcome!

10 |
11 | About 12 |
13 |
14 | Contacts 15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /Intro to Angular and TypeScript/resources.md: -------------------------------------------------------------------------------- 1 | OSI model: https://www.geeksforgeeks.org/layers-of-osi-model/ 2 | 3 | HTTP :https://dev.to/accreditly/http1-vs-http2-vs-http3-2k1c 4 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/.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 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://localhost:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://localhost:9876/debug.html" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Router, RouterModule, Routes } from '@angular/router'; 3 | import { TodoListComponent } from './todo/todo-list/todo-list.component'; 4 | 5 | export const routes: Routes = [ 6 | { 7 | path: '', 8 | pathMatch: 'full', 9 | redirectTo: 'user/list', 10 | }, 11 | { 12 | path: 'todo-list', 13 | component: TodoListComponent, 14 | }, 15 | ]; 16 | 17 | @NgModule({ 18 | imports: [RouterModule.forRoot(routes)], 19 | exports: [RouterModule], 20 | }) 21 | export class AppRoutingModule {} 22 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Modules and Routing/modules-and-routing/src/app/app.component.css -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/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 = 'modules-and-routing'; 10 | } 11 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/core/core.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { GlobalLoaderComponent } from './global-loader/global-loader.component'; 4 | import { SharedModule } from '../shared/shared.module'; 5 | import { NavigationComponent } from './navigation/navigation.component'; 6 | import { RouterModule } from '@angular/router'; 7 | 8 | @NgModule({ 9 | declarations: [GlobalLoaderComponent, NavigationComponent], 10 | imports: [CommonModule, SharedModule, RouterModule], 11 | exports: [GlobalLoaderComponent, NavigationComponent], 12 | }) 13 | export class CoreModule {} 14 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/core/global-loader/global-loader.component.css: -------------------------------------------------------------------------------- 1 | .loader-wrapper { 2 | background-color: rgb(33, 76, 62, 0.5); 3 | position: absolute; 4 | top: 0; 5 | left: 0; 6 | width: 100%; 7 | height: 100%; 8 | display: flex; 9 | justify-content: center; 10 | align-items: center; 11 | } 12 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/core/global-loader/global-loader.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/core/global-loader/global-loader.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { GlobalLoaderService } from './global-loader.service'; 3 | 4 | @Component({ 5 | selector: 'app-global-loader', 6 | templateUrl: './global-loader.component.html', 7 | styleUrls: ['./global-loader.component.css'], 8 | }) 9 | export class GlobalLoaderComponent { 10 | constructor(public globalLoaderService: GlobalLoaderService) {} 11 | } 12 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/core/global-loader/global-loader.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { GlobalLoaderService } from './global-loader.service'; 4 | 5 | describe('GlobalLoaderService', () => { 6 | let service: GlobalLoaderService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(GlobalLoaderService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/core/global-loader/global-loader.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable({ 4 | providedIn: 'root', 5 | }) 6 | export class GlobalLoaderService { 7 | isHidden: boolean = true; 8 | 9 | showLoader() { 10 | this.isHidden = false; 11 | } 12 | 13 | hideLoader() { 14 | this.isHidden = true; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/core/navigation/navigation.component.css: -------------------------------------------------------------------------------- 1 | .nav-btn { 2 | margin: 10px; 3 | padding: 20px; 4 | border: 1px solid #000; 5 | border-radius: 20px; 6 | cursor: pointer; 7 | width: fit-content; 8 | } 9 | 10 | .nav-btn:hover { 11 | background-color: gray; 12 | color: #fff; 13 | } 14 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/core/navigation/navigation.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Users List 5 | Todo List 6 |
7 | 9 |
10 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/core/navigation/navigation.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | 4 | @Component({ 5 | selector: 'app-navigation', 6 | templateUrl: './navigation.component.html', 7 | styleUrls: ['./navigation.component.css'], 8 | }) 9 | export class NavigationComponent { 10 | constructor(private router: Router) {} 11 | 12 | navigateTo(path: string): void { 13 | this.router.navigate([path]); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/shared/shared.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { SpinnerComponent } from './spinner/spinner.component'; 4 | 5 | @NgModule({ 6 | declarations: [SpinnerComponent], 7 | imports: [CommonModule], 8 | exports: [SpinnerComponent], 9 | }) 10 | export class SharedModule {} 11 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/shared/spinner/spinner.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/shared/spinner/spinner.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-spinner', 5 | templateUrl: './spinner.component.html', 6 | styleUrls: ['./spinner.component.css'], 7 | }) 8 | export class SpinnerComponent {} 9 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/todo/todo-list/todo-list.component.css: -------------------------------------------------------------------------------- 1 | .todo-wrapper { 2 | width: 80%; 3 | height: 120px; 4 | border-radius: 20px; 5 | border: 1px solid #000; 6 | padding: 20px; 7 | margin: 20px; 8 | } 9 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/todo/todo-list/todo-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |

todo-list works!

3 |
4 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/todo/todo-list/todo-list.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-todo-list', 5 | templateUrl: './todo-list.component.html', 6 | styleUrls: ['./todo-list.component.css'], 7 | }) 8 | export class TodoListComponent {} 9 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/todo/todo.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { TodoListComponent } from './todo-list/todo-list.component'; 4 | 5 | @NgModule({ 6 | declarations: [TodoListComponent], 7 | imports: [CommonModule], 8 | exports: [TodoListComponent], 9 | }) 10 | export class TodoModule {} 11 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/types/User.ts: -------------------------------------------------------------------------------- 1 | export interface User { 2 | id: number; 3 | username: string; 4 | } 5 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/user/user-detail/user-detail.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Modules and Routing/modules-and-routing/src/app/user/user-detail/user-detail.component.css -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/user/user-detail/user-detail.component.html: -------------------------------------------------------------------------------- 1 |

user-detail works!

2 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/user/user-detail/user-detail.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { ActivatedRoute } from '@angular/router'; 3 | 4 | @Component({ 5 | selector: 'app-user-detail', 6 | templateUrl: './user-detail.component.html', 7 | styleUrls: ['./user-detail.component.css'], 8 | }) 9 | export class UserDetailComponent { 10 | constructor(private activeRoute: ActivatedRoute) { 11 | // static way 12 | console.log('snapshot.data', this.activeRoute.snapshot.data['user']); 13 | 14 | // dynamic way 15 | this.activeRoute.params.subscribe((v) => 16 | console.log('params.subscribe', v) 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/user/user-list/user-list.component.css: -------------------------------------------------------------------------------- 1 | .user-list-wraper { 2 | display: flex; 3 | justify-content: center; 4 | flex-direction: column; 5 | align-items: center; 6 | padding: 20px; 7 | } 8 | 9 | .clickable { 10 | cursor: pointer; 11 | background-color: aliceblue; 12 | } 13 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/user/user-list/user-list.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
7 |

{{ user.id }} | {{ user.username }}

8 |
9 |
10 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/user/user.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { UserService } from './user.service'; 4 | 5 | describe('UserService', () => { 6 | let service: UserService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(UserService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/app/user/user.service.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient } from '@angular/common/http'; 2 | import { Injectable } from '@angular/core'; 3 | import { User } from '../types/User'; 4 | 5 | @Injectable({ 6 | providedIn: 'root', 7 | }) 8 | export class UserService { 9 | constructor(private http: HttpClient) {} 10 | 11 | fetchUsers() { 12 | return this.http.get('https://jsonplaceholder.typicode.com/users'); 13 | } 14 | 15 | fetchSingleUser(id: number) { 16 | return this.http.get( 17 | `https://jsonplaceholder.typicode.com/users/${id}` 18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Modules and Routing/modules-and-routing/src/assets/.gitkeep -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Modules and Routing/modules-and-routing/src/favicon.ico -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ModulesAndRouting 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app/app.module'; 4 | 5 | 6 | platformBrowserDynamic().bootstrapModule(AppModule) 7 | .catch(err => console.error(err)); 8 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/src/styles.css: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/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 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /Modules and Routing/modules-and-routing/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 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /Q&A/q-and-a-app/.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 | -------------------------------------------------------------------------------- /Q&A/q-and-a-app/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /Q&A/q-and-a-app/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://localhost:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://localhost:9876/debug.html" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /Q&A/q-and-a-app/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | 4 | const routes: Routes = []; 5 | 6 | @NgModule({ 7 | imports: [RouterModule.forRoot(routes)], 8 | exports: [RouterModule] 9 | }) 10 | export class AppRoutingModule { } 11 | -------------------------------------------------------------------------------- /Q&A/q-and-a-app/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Q&A/q-and-a-app/src/app/app.component.css -------------------------------------------------------------------------------- /Q&A/q-and-a-app/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | {{ counter$ | async }} 5 | 6 |
7 |
8 | 9 | 12 |
13 | -------------------------------------------------------------------------------- /Q&A/q-and-a-app/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { Store } from '@ngrx/store'; 3 | import { increment, setValue } from './store/action'; 4 | import { getCounter } from './store/selector'; 5 | 6 | @Component({ 7 | selector: 'app-root', 8 | templateUrl: './app.component.html', 9 | styleUrls: ['./app.component.css'], 10 | }) 11 | export class AppComponent { 12 | counter$ = this.store.select(getCounter); 13 | 14 | constructor(private store: Store) {} 15 | 16 | incrementHandler() { 17 | this.store.dispatch(increment()); 18 | } 19 | 20 | setValueHandler(value: number) { 21 | this.store.dispatch(setValue({ counter: value })); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Q&A/q-and-a-app/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | 4 | import { AppRoutingModule } from './app-routing.module'; 5 | import { AppComponent } from './app.component'; 6 | import { YourComponent } from './your/your.component'; 7 | import { StoreModule } from '@ngrx/store'; 8 | import { reducers } from './store'; 9 | 10 | @NgModule({ 11 | declarations: [AppComponent, YourComponent], 12 | imports: [BrowserModule, AppRoutingModule, StoreModule.forRoot(reducers)], 13 | providers: [], 14 | bootstrap: [AppComponent], 15 | }) 16 | export class AppModule {} 17 | -------------------------------------------------------------------------------- /Q&A/q-and-a-app/src/app/popup.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { PopupService } from './popup.service'; 4 | 5 | describe('PopupService', () => { 6 | let service: PopupService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(PopupService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /Q&A/q-and-a-app/src/app/popup.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Observable } from 'rxjs'; 3 | 4 | @Injectable({ 5 | providedIn: 'root', 6 | }) 7 | export class PopupService { 8 | confirm(msg: string) { 9 | const userChoice = window.confirm(msg); 10 | 11 | return Observable.create((observer: any) => { 12 | observer.next(userChoice); 13 | observer.complete(); 14 | }); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Q&A/q-and-a-app/src/app/store/action.ts: -------------------------------------------------------------------------------- 1 | import { createAction, props } from '@ngrx/store'; 2 | import { MainState } from '.'; 3 | 4 | // action type 5 | const actionType = { 6 | increment: 'INCREMENT', // UNIQUE! ADD PREFIX 7 | setValue: 'SET_VALUE', 8 | }; 9 | 10 | export const increment = createAction(actionType.increment); 11 | export const setValue = createAction(actionType.setValue, props()); 12 | -------------------------------------------------------------------------------- /Q&A/q-and-a-app/src/app/store/selector.ts: -------------------------------------------------------------------------------- 1 | import { createFeatureSelector, createSelector } from '@ngrx/store'; 2 | import { MainState } from '.'; 3 | 4 | const mainSelector = createFeatureSelector('main'); 5 | 6 | export const getCounter = createSelector(mainSelector, (s) => { 7 | return s.counter; 8 | }); 9 | -------------------------------------------------------------------------------- /Q&A/q-and-a-app/src/app/your/your.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Q&A/q-and-a-app/src/app/your/your.component.css -------------------------------------------------------------------------------- /Q&A/q-and-a-app/src/app/your/your.component.html: -------------------------------------------------------------------------------- 1 |

your works!

2 | 3 | -------------------------------------------------------------------------------- /Q&A/q-and-a-app/src/app/your/your.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { YourComponent } from './your.component'; 4 | 5 | describe('YourComponent', () => { 6 | let component: YourComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [YourComponent] 12 | }); 13 | fixture = TestBed.createComponent(YourComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /Q&A/q-and-a-app/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Q&A/q-and-a-app/src/assets/.gitkeep -------------------------------------------------------------------------------- /Q&A/q-and-a-app/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Q&A/q-and-a-app/src/favicon.ico -------------------------------------------------------------------------------- /Q&A/q-and-a-app/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | QAndAApp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Q&A/q-and-a-app/src/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app/app.module'; 4 | 5 | 6 | platformBrowserDynamic().bootstrapModule(AppModule) 7 | .catch(err => console.error(err)); 8 | -------------------------------------------------------------------------------- /Q&A/q-and-a-app/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /Q&A/q-and-a-app/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 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /Q&A/q-and-a-app/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 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Angular-June-2023 -------------------------------------------------------------------------------- /Workshop Components/Rest-api/.gitattributes: -------------------------------------------------------------------------------- 1 | *.css linguist-detectable=false 2 | *.html linguist-detectable=false 3 | *.js linguist-detectable=true -------------------------------------------------------------------------------- /Workshop Components/Rest-api/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /.env 3 | -------------------------------------------------------------------------------- /Workshop Components/Rest-api/.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": "node", 9 | "request": "launch", 10 | "name": "Launch Program", 11 | "skipFiles": [ 12 | "/**" 13 | ], 14 | "program": "${workspaceFolder}/index.js" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /Workshop Components/Rest-api/app-config.js: -------------------------------------------------------------------------------- 1 | const authCookieName = 'auth-cookie'; 2 | 3 | module.exports = { 4 | authCookieName, 5 | } -------------------------------------------------------------------------------- /Workshop Components/Rest-api/config/config.js: -------------------------------------------------------------------------------- 1 | const env = process.env.NODE_ENV || "development"; 2 | 3 | const config = { 4 | development: { 5 | port: process.env.PORT || 3000, 6 | dbURL: "mongodb://localhost:27017/forum", 7 | origin: ["http://localhost:5555", "http://localhost:4200"], 8 | }, 9 | production: { 10 | port: process.env.PORT || 3000, 11 | dbURL: process.env.DB_URL_CREDENTIALS, 12 | origin: [], 13 | }, 14 | }; 15 | 16 | module.exports = config[env]; 17 | -------------------------------------------------------------------------------- /Workshop Components/Rest-api/config/db.js: -------------------------------------------------------------------------------- 1 | const config = require("./config"); 2 | const mongoose = require("mongoose"); 3 | 4 | module.exports = () => { 5 | return mongoose.connect(config.dbURL, { 6 | useNewUrlParser: true, 7 | useUnifiedTopology: true, 8 | // useCreateIndex: true, 9 | // useFindAndModify: false 10 | }); 11 | }; 12 | -------------------------------------------------------------------------------- /Workshop Components/Rest-api/config/express.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const path = require('path'); 3 | const cookieParser = require('cookie-parser'); 4 | const cookieSecret = process.env.COOKIESECRET || 'SoftUni'; 5 | // const { errorHandler } = require('../utils') 6 | 7 | module.exports = (app) => { 8 | app.use(express.json()); 9 | 10 | app.use(cookieParser(cookieSecret)); 11 | 12 | app.use(express.static(path.resolve(__basedir, 'static'))); 13 | 14 | // app.use(errorHandler(err, req, res, next)); 15 | }; 16 | -------------------------------------------------------------------------------- /Workshop Components/Rest-api/controllers/index.js: -------------------------------------------------------------------------------- 1 | const authController = require('./auth'); 2 | const themeController = require('./themeController'); 3 | const postController = require('./postController'); 4 | 5 | module.exports = { 6 | authController, 7 | themeController, 8 | postController, 9 | } -------------------------------------------------------------------------------- /Workshop Components/Rest-api/models/index.js: -------------------------------------------------------------------------------- 1 | const userModel = require('./userModel'); 2 | const tokenBlacklistModel = require('./tokenBlacklistModel'); 3 | const themeModel = require('./themeModel'); 4 | const postModel = require('./postModel'); 5 | 6 | module.exports = { 7 | userModel, 8 | tokenBlacklistModel, 9 | themeModel, 10 | postModel, 11 | } -------------------------------------------------------------------------------- /Workshop Components/Rest-api/models/postModel.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const { ObjectId } = mongoose.Schema.Types; 3 | 4 | const postSchema = new mongoose.Schema({ 5 | text: { 6 | type: String, 7 | required: true 8 | }, 9 | likes: [{ 10 | type: ObjectId, 11 | ref: "User" 12 | }], 13 | userId: { 14 | type: ObjectId, 15 | ref: "User" 16 | }, 17 | themeId: { 18 | type: ObjectId, 19 | ref: "Theme" 20 | }, 21 | }, { timestamps: { createdAt: 'created_at' } }); 22 | 23 | module.exports = mongoose.model('Post', postSchema); 24 | -------------------------------------------------------------------------------- /Workshop Components/Rest-api/models/themeModel.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const { ObjectId } = mongoose.Schema.Types; 3 | 4 | const themeSchema = new mongoose.Schema({ 5 | themeName: { 6 | type: String, 7 | required: true 8 | }, 9 | subscribers: [{ 10 | type: ObjectId, 11 | ref: "User" 12 | }], 13 | userId: { 14 | type: ObjectId, 15 | ref: "User" 16 | }, 17 | posts: [{ 18 | type: ObjectId, 19 | ref: "Post" 20 | }], 21 | }, { timestamps: { createdAt: 'created_at' } }); 22 | 23 | module.exports = mongoose.model('Theme', themeSchema); 24 | -------------------------------------------------------------------------------- /Workshop Components/Rest-api/models/tokenBlacklistModel.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | 3 | const tokenBlacklistSchema = new mongoose.Schema({ 4 | token: String, 5 | }, { timestamps: { createdAt: 'created_at' } }); 6 | 7 | 8 | module.exports = mongoose.model('TokenBlacklist', tokenBlacklistSchema); -------------------------------------------------------------------------------- /Workshop Components/Rest-api/router/index.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const users = require('./users'); 3 | const themes = require('./themes'); 4 | const posts = require('./posts'); 5 | const likes = require('./likes'); 6 | const test = require('./test'); 7 | const { authController } = require('../controllers'); 8 | 9 | router.post('/register', authController.register); 10 | router.post('/login', authController.login); 11 | router.post('/logout', authController.logout); 12 | 13 | router.use('/users', users); 14 | router.use('/themes', themes); 15 | router.use('/posts', posts); 16 | router.use('/likes', likes); 17 | router.use('/test', test); 18 | 19 | module.exports = router; 20 | -------------------------------------------------------------------------------- /Workshop Components/Rest-api/router/likes.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const { auth } = require('../utils'); 4 | const { postController } = require('../controllers'); 5 | 6 | // middleware that is specific to this router 7 | 8 | router.put('/:postId', auth(), postController.like); 9 | 10 | module.exports = router 11 | -------------------------------------------------------------------------------- /Workshop Components/Rest-api/router/posts.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const { auth } = require('../utils'); 4 | const { postController } = require('../controllers'); 5 | 6 | // middleware that is specific to this router 7 | 8 | router.get('/', postController.getLatestsPosts); 9 | 10 | module.exports = router -------------------------------------------------------------------------------- /Workshop Components/Rest-api/router/test.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const utils = require('../utils') 4 | 5 | // middleware that is specific to this router 6 | 7 | const data = { 8 | "name": "rest-api", 9 | "version": "1.0.0", 10 | "description": "REST-api for back-end of Angular course workshop in SoftUni", 11 | "main": "index.js", 12 | } 13 | 14 | router.get('/', function (req, res) { 15 | 16 | res.send(data); 17 | }) 18 | 19 | module.exports = router -------------------------------------------------------------------------------- /Workshop Components/Rest-api/router/users.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const { authController } = require('../controllers'); 4 | const { auth } = require('../utils'); 5 | 6 | router.get('/profile', auth(),authController.getProfileInfo); 7 | router.put('/profile', auth(),authController.editProfileInfo); 8 | 9 | module.exports = router -------------------------------------------------------------------------------- /Workshop Components/Rest-api/utils/errHandler.js: -------------------------------------------------------------------------------- 1 | function errorHandler(err, req, res, next) { 2 | if (err.status === 333) { 3 | res.status(333) 4 | .json({ message: 'ErrorHandler: not allowed!' }) 5 | } else { 6 | console.error(err.stack) 7 | // console.log(err) 8 | res.status(500) 9 | .json({ message: 'ErrorHandler: Something went wrong!', err }) 10 | } 11 | } 12 | 13 | module.exports = errorHandler; 14 | -------------------------------------------------------------------------------- /Workshop Components/Rest-api/utils/index.js: -------------------------------------------------------------------------------- 1 | const jwt = require('./jwt'); 2 | const auth = require('./auth'); 3 | const errorHandler = require('./errHandler'); 4 | 5 | module.exports = { 6 | jwt, 7 | auth, 8 | errorHandler 9 | } 10 | -------------------------------------------------------------------------------- /Workshop Components/Rest-api/utils/jwt.js: -------------------------------------------------------------------------------- 1 | const jwt = require('jsonwebtoken'); 2 | const secret = process.env.SECRET || 'SoftSecret'; 3 | 4 | function createToken(data) { 5 | return jwt.sign(data, secret, { expiresIn: '1d' }); 6 | } 7 | 8 | function verifyToken(token) { 9 | return new Promise((resolve, reject) => { 10 | jwt.verify(token, secret, (err, data) => { 11 | if (err) { 12 | reject(err); 13 | return; 14 | } 15 | resolve(data); 16 | }); 17 | }); 18 | } 19 | 20 | module.exports = { 21 | createToken, 22 | verifyToken 23 | } -------------------------------------------------------------------------------- /Workshop Components/components-workshop/.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 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://localhost:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://localhost:9876/debug.html" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/api.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { ApiService } from './api.service'; 4 | 5 | describe('ApiService', () => { 6 | let service: ApiService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(ApiService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | 4 | const routes: Routes = []; 5 | 6 | @NgModule({ 7 | imports: [RouterModule.forRoot(routes)], 8 | exports: [RouterModule] 9 | }) 10 | export class AppRoutingModule { } 11 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Workshop Components/components-workshop/src/app/app.component.css -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/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 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/core/core.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { HeaderComponent } from './header/header.component'; 4 | import { FooterComponent } from './footer/footer.component'; 5 | 6 | @NgModule({ 7 | declarations: [HeaderComponent, FooterComponent], 8 | imports: [CommonModule], 9 | // Note: tells which components to be exported from this module 10 | exports: [HeaderComponent, FooterComponent], 11 | }) 12 | export class CoreModule {} 13 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/core/footer/footer.component.css: -------------------------------------------------------------------------------- 1 | /* footer */ 2 | footer { 3 | background: rgb(0, 212, 255); 4 | margin-top: 1em; 5 | position: absolute; 6 | bottom: 0; 7 | width: 100%; 8 | max-width: 1366px; 9 | } 10 | 11 | footer p { 12 | margin: 0; 13 | padding: 0; 14 | font-size: 0.7em; 15 | text-align: center; 16 | } 17 | 18 | footer span { 19 | font-size: 1.5em; 20 | } 21 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/core/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |

This site is designed to be used for training purposes at SoftUni.

3 |

You can find the real SoftUni forum at this link:

4 |

5 | https://softuni.bg/forum 6 | Angular course Copyright © 2020 7 |

8 |
9 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/core/footer/footer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FooterComponent } from './footer.component'; 4 | 5 | describe('FooterComponent', () => { 6 | let component: FooterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [FooterComponent] 12 | }); 13 | fixture = TestBed.createComponent(FooterComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/core/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/core/header/header.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeaderComponent } from './header.component'; 4 | 5 | describe('HeaderComponent', () => { 6 | let component: HeaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [HeaderComponent] 12 | }); 13 | fixture = TestBed.createComponent(HeaderComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/core/header/header.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-header', 5 | templateUrl: './header.component.html', 6 | styleUrls: ['./header.component.css'], 7 | }) 8 | export class HeaderComponent { 9 | isLoggedIn: boolean = true; 10 | } 11 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/main/main.component.css: -------------------------------------------------------------------------------- 1 | /* main */ 2 | main { 3 | width: 50%; 4 | } 5 | 6 | .container { 7 | width: 90%; 8 | margin: auto; 9 | padding-bottom: 4.5em; 10 | display: flex; 11 | align-items: flex-start; 12 | justify-content: space-evenly; 13 | } 14 | 15 | aside { 16 | width: 29%; 17 | margin-top: 1em; 18 | font-size: 0.8em; 19 | } 20 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/main/main.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/main/main.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { MainComponent } from './main.component'; 4 | 5 | describe('MainComponent', () => { 6 | let component: MainComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [MainComponent] 12 | }); 13 | fixture = TestBed.createComponent(MainComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/main/main.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-main', 5 | templateUrl: './main.component.html', 6 | styleUrls: ['./main.component.css'] 7 | }) 8 | export class MainComponent { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/posts-list/posts-list.component.html: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/shared/loader/loader.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Workshop Components/components-workshop/src/app/shared/loader/loader.component.css -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/shared/loader/loader.component.html: -------------------------------------------------------------------------------- 1 |
Loading...
2 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/shared/loader/loader.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LoaderComponent } from './loader.component'; 4 | 5 | describe('LoaderComponent', () => { 6 | let component: LoaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [LoaderComponent] 12 | }); 13 | fixture = TestBed.createComponent(LoaderComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/shared/loader/loader.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-loader', 5 | templateUrl: './loader.component.html', 6 | styleUrls: ['./loader.component.css'], 7 | }) 8 | export class LoaderComponent {} 9 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/shared/shared.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { LoaderComponent } from './loader/loader.component'; 4 | 5 | @NgModule({ 6 | declarations: [LoaderComponent], 7 | imports: [CommonModule], 8 | exports: [LoaderComponent], 9 | }) 10 | export class SharedModule {} 11 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/types/post.ts: -------------------------------------------------------------------------------- 1 | import { Theme } from './theme'; 2 | import { UserId } from './user-id'; 3 | 4 | export interface Post { 5 | likes: string[]; 6 | _id: string; 7 | text: string; 8 | userId: UserId; 9 | themeId: Theme; 10 | created_at: string; 11 | updatedAt: string; 12 | __v: number; 13 | } 14 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/types/theme.ts: -------------------------------------------------------------------------------- 1 | import { UserId } from './user-id'; 2 | 3 | export interface Theme { 4 | subscribers: string[]; 5 | posts: string[]; 6 | _id: string; 7 | themeName: string; 8 | userId: UserId; 9 | created_at: string; 10 | updatedAt: string; 11 | __v: number; 12 | } 13 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/app/types/user-id.ts: -------------------------------------------------------------------------------- 1 | export interface UserId { 2 | themes: string[]; 3 | posts: string[]; 4 | _id: string; 5 | tel: string; 6 | email: string; 7 | username: string; 8 | password: string; 9 | created_at: string; 10 | updatedAt: string; 11 | __v: number; 12 | } 13 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Workshop Components/components-workshop/src/assets/.gitkeep -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/environments/environment.development.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | appUrl: 'http://localhost:3000/api', 3 | }; 4 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | appUrl: 'http://localhost:3000/api', // domain -> will not be localhost in prod 3 | }; 4 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Workshop Components/components-workshop/src/favicon.ico -------------------------------------------------------------------------------- /Workshop Components/components-workshop/src/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app/app.module'; 4 | 5 | 6 | platformBrowserDynamic().bootstrapModule(AppModule) 7 | .catch(err => console.error(err)); 8 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/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 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /Workshop Components/components-workshop/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 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /Workshop Components/resources/forum/posts.bson: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Workshop Components/resources/forum/posts.bson -------------------------------------------------------------------------------- /Workshop Components/resources/forum/posts.metadata.json: -------------------------------------------------------------------------------- 1 | {"options":{},"indexes":[{"v":2,"key":{"_id":1},"name":"_id_","ns":"forum.posts"}],"uuid":"8e8754eadf90424aa5cf5d9e2bfbb48e"} -------------------------------------------------------------------------------- /Workshop Components/resources/forum/themes.bson: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Workshop Components/resources/forum/themes.bson -------------------------------------------------------------------------------- /Workshop Components/resources/forum/themes.metadata.json: -------------------------------------------------------------------------------- 1 | {"options":{},"indexes":[{"v":2,"key":{"_id":1},"name":"_id_","ns":"forum.themes"}],"uuid":"a9e25cd8f9d44ee39d90dc2584bf437d"} -------------------------------------------------------------------------------- /Workshop Components/resources/forum/users.bson: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Workshop Components/resources/forum/users.bson -------------------------------------------------------------------------------- /Workshop Components/resources/forum/users.metadata.json: -------------------------------------------------------------------------------- 1 | {"options":{},"indexes":[{"v":2,"key":{"_id":1},"name":"_id_","ns":"forum.users"},{"v":2,"unique":true,"key":{"email":1},"name":"email_1","ns":"forum.users","background":true},{"v":2,"unique":true,"key":{"username":1},"name":"username_1","ns":"forum.users","background":true}],"uuid":"d1f59d47b68c427eb89196b588247543"} -------------------------------------------------------------------------------- /Workshop Components/resources/views/layout.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | } 4 | 5 | .site { 6 | max-width: 50em; 7 | margin: 0 auto; 8 | } 9 | 10 | table { 11 | border: 1px solid #ccc; 12 | width: 100%; 13 | border-spacing: 0.2em; 14 | margin-bottom: 1.5em; 15 | } 16 | 17 | table td, 18 | table th { 19 | border: 1px solid #ccc; 20 | padding: 0.4em 0.8em; 21 | } 22 | 23 | table td { 24 | background: #eee; 25 | } 26 | 27 | table thead th, 28 | table tfoot td { 29 | font-weight: bold; 30 | text-align: left; 31 | background: #000; 32 | color: #fff; 33 | } 34 | 35 | table tbody tr:nth-child(even) td { 36 | background: #ccc; 37 | } 38 | -------------------------------------------------------------------------------- /Workshop Components/resources/views/reset.css: -------------------------------------------------------------------------------- 1 | /* 2 | *Removes all default whitespace 3 | */ 4 | 5 | * { 6 | padding: 0; 7 | margin: 0; 8 | } 9 | 10 | /* 11 | *Reset CSS model sizing calculations 12 | */ 13 | 14 | html { 15 | box-sizing: border-box; 16 | } 17 | 18 | *, 19 | *:before, 20 | *:after { 21 | box-sizing: inherit; 22 | } 23 | -------------------------------------------------------------------------------- /Workshop Components/resources/views/responsive.css: -------------------------------------------------------------------------------- 1 | @media (min-width: 800px) { 2 | html { 3 | font-size: 14px; 4 | } 5 | } 6 | 7 | @media (min-width: 1024px) { 8 | html { 9 | font-size: 16px; 10 | } 11 | } 12 | 13 | @media (min-width: 1280px) { 14 | html { 15 | font-size: 18px; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Workshop Components/resources/views/style.css: -------------------------------------------------------------------------------- 1 | @import url("reset.css"); 2 | @import url("layout.css"); 3 | @import url("typography.css"); 4 | @import url("responsive.css"); 5 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/.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 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://localhost:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://localhost:9876/debug.html" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/api.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { ApiService } from './api.service'; 4 | 5 | describe('ApiService', () => { 6 | let service: ApiService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(ApiService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | import { HomeComponent } from './home/home.component'; 4 | import { NotFoundComponent } from './not-found/not-found.component'; 5 | 6 | const routes: Routes = [ 7 | { 8 | path: '', 9 | pathMatch: 'full', 10 | redirectTo: '/home', 11 | }, 12 | { 13 | path: 'home', 14 | component: HomeComponent, 15 | }, 16 | { path: '**', component: NotFoundComponent }, 17 | ]; 18 | 19 | @NgModule({ 20 | imports: [RouterModule.forRoot(routes)], 21 | exports: [RouterModule], 22 | }) 23 | export class AppRoutingModule {} 24 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Workshop Forms/workshop-forms/src/app/app.component.css -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-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 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/core/core.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { HeaderComponent } from './header/header.component'; 4 | import { FooterComponent } from './footer/footer.component'; 5 | import { RouterModule } from '@angular/router'; 6 | 7 | @NgModule({ 8 | declarations: [HeaderComponent, FooterComponent], 9 | imports: [CommonModule, RouterModule], 10 | // Note: tells which components to be exported from this module 11 | exports: [HeaderComponent, FooterComponent], 12 | }) 13 | export class CoreModule {} 14 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/core/footer/footer.component.css: -------------------------------------------------------------------------------- 1 | /* footer */ 2 | footer { 3 | background: rgb(0, 212, 255); 4 | margin-top: 1em; 5 | position: absolute; 6 | bottom: 0; 7 | width: 100%; 8 | max-width: 1366px; 9 | } 10 | 11 | footer p { 12 | margin: 0; 13 | padding: 0; 14 | font-size: 0.7em; 15 | text-align: center; 16 | } 17 | 18 | footer span { 19 | font-size: 1.5em; 20 | } 21 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/core/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |

This site is designed to be used for training purposes at SoftUni.

3 |

You can find the real SoftUni forum at this link:

4 |

5 | https://softuni.bg/forum 6 | Angular course Copyright © 2020 7 |

8 |
9 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/core/footer/footer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FooterComponent } from './footer.component'; 4 | 5 | describe('FooterComponent', () => { 6 | let component: FooterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [FooterComponent] 12 | }); 13 | fixture = TestBed.createComponent(FooterComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/core/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/core/header/header.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeaderComponent } from './header.component'; 4 | 5 | describe('HeaderComponent', () => { 6 | let component: HeaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [HeaderComponent] 12 | }); 13 | fixture = TestBed.createComponent(HeaderComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/home/home.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Workshop Forms/workshop-forms/src/app/home/home.component.css -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HomeComponent } from './home.component'; 4 | 5 | describe('HomeComponent', () => { 6 | let component: HomeComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [HomeComponent] 12 | }); 13 | fixture = TestBed.createComponent(HomeComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { UserService } from '../user/user.service'; 3 | 4 | @Component({ 5 | selector: 'app-home', 6 | templateUrl: './home.component.html', 7 | styleUrls: ['./home.component.css'], 8 | }) 9 | export class HomeComponent {} 10 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/main/main.component.css: -------------------------------------------------------------------------------- 1 | /* main */ 2 | main { 3 | width: 50%; 4 | } 5 | 6 | .container { 7 | width: 90%; 8 | margin: auto; 9 | padding-bottom: 4.5em; 10 | display: flex; 11 | align-items: flex-start; 12 | justify-content: space-evenly; 13 | } 14 | 15 | aside { 16 | width: 29%; 17 | margin-top: 1em; 18 | font-size: 0.8em; 19 | } 20 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/main/main.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/main/main.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { MainComponent } from './main.component'; 4 | 5 | describe('MainComponent', () => { 6 | let component: MainComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [MainComponent] 12 | }); 13 | fixture = TestBed.createComponent(MainComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/main/main.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-main', 5 | templateUrl: './main.component.html', 6 | styleUrls: ['./main.component.css'], 7 | }) 8 | export class MainComponent {} 9 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/not-found/not-found.component.html: -------------------------------------------------------------------------------- 1 |
2 |
4
3 | 4 |
4
5 |
6 | Ooops! Page Not Found 7 |

Let's go home and try from there.

8 |
9 |
10 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/not-found/not-found.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { NotFoundComponent } from './not-found.component'; 4 | 5 | describe('NotFoundComponent', () => { 6 | let component: NotFoundComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [NotFoundComponent] 12 | }); 13 | fixture = TestBed.createComponent(NotFoundComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/not-found/not-found.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-not-found', 5 | templateUrl: './not-found.component.html', 6 | styleUrls: ['./not-found.component.css'], 7 | }) 8 | export class NotFoundComponent {} 9 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/posts-list/posts-list.component.html: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/shared/constants.ts: -------------------------------------------------------------------------------- 1 | export const DEFAULT_EMAIL_DOMAINS = ["bg", "com"]; 2 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/shared/loader/loader.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Workshop Forms/workshop-forms/src/app/shared/loader/loader.component.css -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/shared/loader/loader.component.html: -------------------------------------------------------------------------------- 1 |
Loading...
2 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/shared/loader/loader.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LoaderComponent } from './loader.component'; 4 | 5 | describe('LoaderComponent', () => { 6 | let component: LoaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [LoaderComponent] 12 | }); 13 | fixture = TestBed.createComponent(LoaderComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/shared/loader/loader.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-loader', 5 | templateUrl: './loader.component.html', 6 | styleUrls: ['./loader.component.css'], 7 | }) 8 | export class LoaderComponent {} 9 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/shared/shared.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from "@angular/core"; 2 | import { CommonModule } from "@angular/common"; 3 | import { LoaderComponent } from "./loader/loader.component"; 4 | import { AppEmailDirective } from "./validators/app-email.directive"; 5 | 6 | @NgModule({ 7 | declarations: [LoaderComponent, AppEmailDirective], 8 | imports: [CommonModule], 9 | exports: [LoaderComponent, AppEmailDirective], 10 | }) 11 | export class SharedModule {} 12 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/shared/validators/app-email-validator.ts: -------------------------------------------------------------------------------- 1 | import { ValidatorFn } from "@angular/forms"; 2 | 3 | export function appEmailValidator(domains: string[]): ValidatorFn { 4 | const domainStrings = domains.join("|"); // ['bg', 'com'] => bg|com 5 | const regExp = new RegExp(`[^@]{6,}@gmail\.(${domainStrings})$`); 6 | 7 | return (control) => { 8 | const x = control.value; 9 | const z = regExp.test(control.value); 10 | return control.value === "" || regExp.test(control.value) 11 | ? null 12 | : { appEmailValidator: true }; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/shared/validators/app-email.directive.spec.ts: -------------------------------------------------------------------------------- 1 | import { AppEmailDirective } from './app-email.directive'; 2 | 3 | describe('AppEmailDirective', () => { 4 | it('should create an instance', () => { 5 | const directive = new AppEmailDirective(); 6 | expect(directive).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/shared/validators/match-passwords-validator.ts: -------------------------------------------------------------------------------- 1 | import { FormGroup, ValidatorFn } from "@angular/forms"; 2 | 3 | export function matchPasswordsValidator( 4 | passwordCtrlOne: string, 5 | passwordCtrlTwo: string 6 | ): ValidatorFn { 7 | return (control) => { 8 | const group = control as FormGroup; 9 | const passCtrl1 = group.get(passwordCtrlOne); 10 | const passCtrl2 = group.get(passwordCtrlTwo); 11 | 12 | return passCtrl1?.value === passCtrl2?.value 13 | ? null 14 | : { matchPasswordsValidator: true }; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/theme/new-theme/new-theme.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | import { NgForm } from "@angular/forms"; 3 | 4 | @Component({ 5 | selector: "app-new-theme", 6 | templateUrl: "./new-theme.component.html", 7 | styleUrls: ["./new-theme.component.css"], 8 | }) 9 | export class NewThemeComponent { 10 | newThemeSubmitHandler(form: NgForm): void { 11 | if (form.invalid) { 12 | return; 13 | } 14 | 15 | console.log(form.value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/theme/theme.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from "@angular/core"; 2 | import { CommonModule } from "@angular/common"; 3 | import { NewThemeComponent } from "./new-theme/new-theme.component"; 4 | import { CurrentThemeComponent } from "./current-theme/current-theme.component"; 5 | import { ThemeRoutingModule } from "./theme-routing.module"; 6 | import { FormsModule } from "@angular/forms"; 7 | 8 | @NgModule({ 9 | declarations: [NewThemeComponent, CurrentThemeComponent], 10 | imports: [CommonModule, ThemeRoutingModule, FormsModule], 11 | }) 12 | export class ThemeModule {} 13 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/types/post.ts: -------------------------------------------------------------------------------- 1 | import { Theme } from './theme'; 2 | import { UserId } from './user-id'; 3 | 4 | export interface Post { 5 | likes: string[]; 6 | _id: string; 7 | text: string; 8 | userId: UserId; 9 | themeId: Theme; 10 | created_at: string; 11 | updatedAt: string; 12 | __v: number; 13 | } 14 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/types/theme.ts: -------------------------------------------------------------------------------- 1 | import { Post } from './post'; 2 | import { UserId } from './user-id'; 3 | 4 | export interface Theme { 5 | subscribers: string[]; 6 | posts: any; // string[] | Post[]; 7 | _id: string; 8 | themeName: string; 9 | userId: UserId; 10 | created_at: string; 11 | updatedAt: string; 12 | __v: number; 13 | } 14 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/types/user-id.ts: -------------------------------------------------------------------------------- 1 | export interface UserId { 2 | themes: string[]; 3 | posts: string[]; 4 | _id: string; 5 | tel: string; 6 | email: string; 7 | username: string; 8 | password: string; 9 | created_at: string; 10 | updatedAt: string; 11 | __v: number; 12 | } 13 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/types/user.ts: -------------------------------------------------------------------------------- 1 | export interface User { 2 | email: string; 3 | firstName: string; 4 | // phoneNumber: string; 5 | // password: string; 6 | } 7 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/user/login/login.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LoginComponent } from './login.component'; 4 | 5 | describe('LoginComponent', () => { 6 | let component: LoginComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [LoginComponent] 12 | }); 13 | fixture = TestBed.createComponent(LoginComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/user/profile/profile.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ProfileComponent } from './profile.component'; 4 | 5 | describe('ProfileComponent', () => { 6 | let component: ProfileComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ProfileComponent] 12 | }); 13 | fixture = TestBed.createComponent(ProfileComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/user/register/register.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { RegisterComponent } from './register.component'; 4 | 5 | describe('RegisterComponent', () => { 6 | let component: RegisterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [RegisterComponent] 12 | }); 13 | fixture = TestBed.createComponent(RegisterComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/user/user.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { UserService } from './user.service'; 4 | 5 | describe('UserService', () => { 6 | let service: UserService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(UserService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/welcome/welcome.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { WelcomeComponent } from './welcome.component'; 4 | 5 | describe('WelcomeComponent', () => { 6 | let component: WelcomeComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [WelcomeComponent] 12 | }); 13 | fixture = TestBed.createComponent(WelcomeComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/app/welcome/welcome.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { UserService } from '../user/user.service'; 3 | 4 | @Component({ 5 | selector: 'app-welcome', 6 | templateUrl: './welcome.component.html', 7 | styleUrls: ['./welcome.component.css'], 8 | }) 9 | export class WelcomeComponent { 10 | constructor(private userService: UserService) {} 11 | 12 | get isLogged(): boolean { 13 | return this.userService.isLogged; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Workshop Forms/workshop-forms/src/assets/.gitkeep -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/assets/profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Workshop Forms/workshop-forms/src/assets/profile.png -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/environments/environment.development.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | appUrl: 'http://localhost:3000/api', 3 | }; 4 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | appUrl: 'http://localhost:3000/api', // domain -> will not be localhost in prod 3 | }; 4 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Workshop Forms/workshop-forms/src/favicon.ico -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/src/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app/app.module'; 4 | 5 | 6 | platformBrowserDynamic().bootstrapModule(AppModule) 7 | .catch(err => console.error(err)); 8 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/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 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /Workshop Forms/workshop-forms/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 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/Rest-api/.gitattributes: -------------------------------------------------------------------------------- 1 | *.css linguist-detectable=false 2 | *.html linguist-detectable=false 3 | *.js linguist-detectable=true -------------------------------------------------------------------------------- /Workshop Modules and Routing/Rest-api/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /.env 3 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/Rest-api/.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": "node", 9 | "request": "launch", 10 | "name": "Launch Program", 11 | "skipFiles": [ 12 | "/**" 13 | ], 14 | "program": "${workspaceFolder}/index.js" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /Workshop Modules and Routing/Rest-api/app-config.js: -------------------------------------------------------------------------------- 1 | const authCookieName = 'auth-cookie'; 2 | 3 | module.exports = { 4 | authCookieName, 5 | } -------------------------------------------------------------------------------- /Workshop Modules and Routing/Rest-api/config/config.js: -------------------------------------------------------------------------------- 1 | const env = process.env.NODE_ENV || "development"; 2 | 3 | const config = { 4 | development: { 5 | port: process.env.PORT || 3000, 6 | dbURL: "mongodb://localhost:27017/forum", 7 | origin: ["http://localhost:5555", "http://localhost:4200"], 8 | }, 9 | production: { 10 | port: process.env.PORT || 3000, 11 | dbURL: process.env.DB_URL_CREDENTIALS, 12 | origin: [], 13 | }, 14 | }; 15 | 16 | module.exports = config[env]; 17 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/Rest-api/config/db.js: -------------------------------------------------------------------------------- 1 | const config = require('./config'); 2 | const mongoose = require('mongoose'); 3 | 4 | module.exports = () => { 5 | return mongoose.connect(config.dbURL, { 6 | useNewUrlParser: true, 7 | useUnifiedTopology: true, 8 | useCreateIndex: true, 9 | useFindAndModify: false 10 | }); 11 | }; 12 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/Rest-api/config/express.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const path = require('path'); 3 | const cookieParser = require('cookie-parser'); 4 | const cookieSecret = process.env.COOKIESECRET || 'SoftUni'; 5 | // const { errorHandler } = require('../utils') 6 | 7 | module.exports = (app) => { 8 | app.use(express.json()); 9 | 10 | app.use(cookieParser(cookieSecret)); 11 | 12 | app.use(express.static(path.resolve(__basedir, 'static'))); 13 | 14 | // app.use(errorHandler(err, req, res, next)); 15 | }; 16 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/Rest-api/controllers/index.js: -------------------------------------------------------------------------------- 1 | const authController = require('./auth'); 2 | const themeController = require('./themeController'); 3 | const postController = require('./postController'); 4 | 5 | module.exports = { 6 | authController, 7 | themeController, 8 | postController, 9 | } -------------------------------------------------------------------------------- /Workshop Modules and Routing/Rest-api/models/index.js: -------------------------------------------------------------------------------- 1 | const userModel = require('./userModel'); 2 | const tokenBlacklistModel = require('./tokenBlacklistModel'); 3 | const themeModel = require('./themeModel'); 4 | const postModel = require('./postModel'); 5 | 6 | module.exports = { 7 | userModel, 8 | tokenBlacklistModel, 9 | themeModel, 10 | postModel, 11 | } -------------------------------------------------------------------------------- /Workshop Modules and Routing/Rest-api/models/postModel.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const { ObjectId } = mongoose.Schema.Types; 3 | 4 | const postSchema = new mongoose.Schema({ 5 | text: { 6 | type: String, 7 | required: true 8 | }, 9 | likes: [{ 10 | type: ObjectId, 11 | ref: "User" 12 | }], 13 | userId: { 14 | type: ObjectId, 15 | ref: "User" 16 | }, 17 | themeId: { 18 | type: ObjectId, 19 | ref: "Theme" 20 | }, 21 | }, { timestamps: { createdAt: 'created_at' } }); 22 | 23 | module.exports = mongoose.model('Post', postSchema); 24 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/Rest-api/models/themeModel.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const { ObjectId } = mongoose.Schema.Types; 3 | 4 | const themeSchema = new mongoose.Schema({ 5 | themeName: { 6 | type: String, 7 | required: true 8 | }, 9 | subscribers: [{ 10 | type: ObjectId, 11 | ref: "User" 12 | }], 13 | userId: { 14 | type: ObjectId, 15 | ref: "User" 16 | }, 17 | posts: [{ 18 | type: ObjectId, 19 | ref: "Post" 20 | }], 21 | }, { timestamps: { createdAt: 'created_at' } }); 22 | 23 | module.exports = mongoose.model('Theme', themeSchema); 24 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/Rest-api/models/tokenBlacklistModel.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | 3 | const tokenBlacklistSchema = new mongoose.Schema({ 4 | token: String, 5 | }, { timestamps: { createdAt: 'created_at' } }); 6 | 7 | 8 | module.exports = mongoose.model('TokenBlacklist', tokenBlacklistSchema); -------------------------------------------------------------------------------- /Workshop Modules and Routing/Rest-api/router/index.js: -------------------------------------------------------------------------------- 1 | const router = require('express').Router(); 2 | const users = require('./users'); 3 | const themes = require('./themes'); 4 | const posts = require('./posts'); 5 | const likes = require('./likes'); 6 | const test = require('./test'); 7 | const { authController } = require('../controllers'); 8 | 9 | router.post('/register', authController.register); 10 | router.post('/login', authController.login); 11 | router.post('/logout', authController.logout); 12 | 13 | router.use('/users', users); 14 | router.use('/themes', themes); 15 | router.use('/posts', posts); 16 | router.use('/likes', likes); 17 | router.use('/test', test); 18 | 19 | module.exports = router; 20 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/Rest-api/router/likes.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const { auth } = require('../utils'); 4 | const { postController } = require('../controllers'); 5 | 6 | // middleware that is specific to this router 7 | 8 | router.put('/:postId', auth(), postController.like); 9 | 10 | module.exports = router 11 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/Rest-api/router/posts.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const { auth } = require('../utils'); 4 | const { postController } = require('../controllers'); 5 | 6 | // middleware that is specific to this router 7 | 8 | router.get('/', postController.getLatestsPosts); 9 | 10 | module.exports = router -------------------------------------------------------------------------------- /Workshop Modules and Routing/Rest-api/router/test.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const utils = require('../utils') 4 | 5 | // middleware that is specific to this router 6 | 7 | const data = { 8 | "name": "rest-api", 9 | "version": "1.0.0", 10 | "description": "REST-api for back-end of Angular course workshop in SoftUni", 11 | "main": "index.js", 12 | } 13 | 14 | router.get('/', function (req, res) { 15 | 16 | res.send(data); 17 | }) 18 | 19 | module.exports = router -------------------------------------------------------------------------------- /Workshop Modules and Routing/Rest-api/router/users.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const { authController } = require('../controllers'); 4 | const { auth } = require('../utils'); 5 | 6 | router.get('/profile', auth(),authController.getProfileInfo); 7 | router.put('/profile', auth(),authController.editProfileInfo); 8 | 9 | module.exports = router -------------------------------------------------------------------------------- /Workshop Modules and Routing/Rest-api/utils/errHandler.js: -------------------------------------------------------------------------------- 1 | function errorHandler(err, req, res, next) { 2 | if (err.status === 333) { 3 | res.status(333) 4 | .json({ message: 'ErrorHandler: not allowed!' }) 5 | } else { 6 | console.error(err.stack) 7 | // console.log(err) 8 | res.status(500) 9 | .json({ message: 'ErrorHandler: Something went wrong!', err }) 10 | } 11 | } 12 | 13 | module.exports = errorHandler; 14 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/Rest-api/utils/index.js: -------------------------------------------------------------------------------- 1 | const jwt = require('./jwt'); 2 | const auth = require('./auth'); 3 | const errorHandler = require('./errHandler'); 4 | 5 | module.exports = { 6 | jwt, 7 | auth, 8 | errorHandler 9 | } 10 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/Rest-api/utils/jwt.js: -------------------------------------------------------------------------------- 1 | const jwt = require('jsonwebtoken'); 2 | const secret = process.env.SECRET || 'SoftSecret'; 3 | 4 | function createToken(data) { 5 | return jwt.sign(data, secret, { expiresIn: '1d' }); 6 | } 7 | 8 | function verifyToken(token) { 9 | return new Promise((resolve, reject) => { 10 | jwt.verify(token, secret, (err, data) => { 11 | if (err) { 12 | reject(err); 13 | return; 14 | } 15 | resolve(data); 16 | }); 17 | }); 18 | } 19 | 20 | module.exports = { 21 | createToken, 22 | verifyToken 23 | } -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/.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 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://localhost:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://localhost:9876/debug.html" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/ASSIGNMENT.md: -------------------------------------------------------------------------------- 1 | // 1. Checkout my branch and run the application. 2 | // 2. Add "Page Not Found" component. 3 | // 3. Implement with local storage "Register" functionality and add it to the relevant place. 4 | // 4. Make "POST" request to the db with "New Theme" component. 5 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/api.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { ApiService } from './api.service'; 4 | 5 | describe('ApiService', () => { 6 | let service: ApiService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(ApiService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | import { HomeComponent } from './home/home.component'; 4 | import { NotFoundComponent } from './not-found/not-found.component'; 5 | 6 | const routes: Routes = [ 7 | { 8 | path: '', 9 | pathMatch: 'full', 10 | redirectTo: '/home', 11 | }, 12 | { 13 | path: 'home', 14 | component: HomeComponent, 15 | }, 16 | { path: '**', component: NotFoundComponent }, 17 | ]; 18 | 19 | @NgModule({ 20 | imports: [RouterModule.forRoot(routes)], 21 | exports: [RouterModule], 22 | }) 23 | export class AppRoutingModule {} 24 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Workshop Modules and Routing/modules-and-routing-workshop/src/app/app.component.css -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/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 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/core/core.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { HeaderComponent } from './header/header.component'; 4 | import { FooterComponent } from './footer/footer.component'; 5 | import { RouterModule } from '@angular/router'; 6 | 7 | @NgModule({ 8 | declarations: [HeaderComponent, FooterComponent], 9 | imports: [CommonModule, RouterModule], 10 | // Note: tells which components to be exported from this module 11 | exports: [HeaderComponent, FooterComponent], 12 | }) 13 | export class CoreModule {} 14 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/core/footer/footer.component.css: -------------------------------------------------------------------------------- 1 | /* footer */ 2 | footer { 3 | background: rgb(0, 212, 255); 4 | margin-top: 1em; 5 | position: absolute; 6 | bottom: 0; 7 | width: 100%; 8 | max-width: 1366px; 9 | } 10 | 11 | footer p { 12 | margin: 0; 13 | padding: 0; 14 | font-size: 0.7em; 15 | text-align: center; 16 | } 17 | 18 | footer span { 19 | font-size: 1.5em; 20 | } 21 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/core/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |

This site is designed to be used for training purposes at SoftUni.

3 |

You can find the real SoftUni forum at this link:

4 |

5 | https://softuni.bg/forum 6 | Angular course Copyright © 2020 7 |

8 |
9 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/core/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/home/home.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Workshop Modules and Routing/modules-and-routing-workshop/src/app/home/home.component.css -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HomeComponent } from './home.component'; 4 | 5 | describe('HomeComponent', () => { 6 | let component: HomeComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [HomeComponent] 12 | }); 13 | fixture = TestBed.createComponent(HomeComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { UserService } from '../user/user.service'; 3 | 4 | @Component({ 5 | selector: 'app-home', 6 | templateUrl: './home.component.html', 7 | styleUrls: ['./home.component.css'], 8 | }) 9 | export class HomeComponent {} 10 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/main/main.component.css: -------------------------------------------------------------------------------- 1 | /* main */ 2 | main { 3 | width: 50%; 4 | } 5 | 6 | .container { 7 | width: 90%; 8 | margin: auto; 9 | padding-bottom: 4.5em; 10 | display: flex; 11 | align-items: flex-start; 12 | justify-content: space-evenly; 13 | } 14 | 15 | aside { 16 | width: 29%; 17 | margin-top: 1em; 18 | font-size: 0.8em; 19 | } 20 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/main/main.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/main/main.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { MainComponent } from './main.component'; 4 | 5 | describe('MainComponent', () => { 6 | let component: MainComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [MainComponent] 12 | }); 13 | fixture = TestBed.createComponent(MainComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/main/main.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-main', 5 | templateUrl: './main.component.html', 6 | styleUrls: ['./main.component.css'], 7 | }) 8 | export class MainComponent {} 9 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/not-found/not-found.component.html: -------------------------------------------------------------------------------- 1 |
2 |
4
3 | 4 |
4
5 |
6 | Ooops! Page Not Found 7 |

Let's go home and try from there.

8 |
9 |
10 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/not-found/not-found.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-not-found', 5 | templateUrl: './not-found.component.html', 6 | styleUrls: ['./not-found.component.css'], 7 | }) 8 | export class NotFoundComponent {} 9 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/shared/loader/loader.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Workshop Modules and Routing/modules-and-routing-workshop/src/app/shared/loader/loader.component.css -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/shared/loader/loader.component.html: -------------------------------------------------------------------------------- 1 |
Loading...
2 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/shared/loader/loader.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-loader', 5 | templateUrl: './loader.component.html', 6 | styleUrls: ['./loader.component.css'], 7 | }) 8 | export class LoaderComponent {} 9 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/shared/shared.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { LoaderComponent } from './loader/loader.component'; 4 | 5 | @NgModule({ 6 | declarations: [LoaderComponent], 7 | imports: [CommonModule], 8 | exports: [LoaderComponent], 9 | }) 10 | export class SharedModule {} 11 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/theme/new-theme/new-theme.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-new-theme', 5 | templateUrl: './new-theme.component.html', 6 | styleUrls: ['./new-theme.component.css'] 7 | }) 8 | export class NewThemeComponent { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/theme/theme.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { NewThemeComponent } from './new-theme/new-theme.component'; 4 | import { CurrentThemeComponent } from './current-theme/current-theme.component'; 5 | import { ThemeRoutingModule } from './theme-routing.module'; 6 | 7 | @NgModule({ 8 | declarations: [NewThemeComponent, CurrentThemeComponent], 9 | imports: [CommonModule, ThemeRoutingModule], 10 | }) 11 | export class ThemeModule {} 12 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/types/post.ts: -------------------------------------------------------------------------------- 1 | import { Theme } from './theme'; 2 | import { UserId } from './user-id'; 3 | 4 | export interface Post { 5 | likes: string[]; 6 | _id: string; 7 | text: string; 8 | userId: UserId; 9 | themeId: Theme; 10 | created_at: string; 11 | updatedAt: string; 12 | __v: number; 13 | } 14 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/types/theme.ts: -------------------------------------------------------------------------------- 1 | import { Post } from './post'; 2 | import { UserId } from './user-id'; 3 | 4 | export interface Theme { 5 | subscribers: string[]; 6 | posts: any; // string[] | Post[]; 7 | _id: string; 8 | themeName: string; 9 | userId: UserId; 10 | created_at: string; 11 | updatedAt: string; 12 | __v: number; 13 | } 14 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/types/user-id.ts: -------------------------------------------------------------------------------- 1 | export interface UserId { 2 | themes: string[]; 3 | posts: string[]; 4 | _id: string; 5 | tel: string; 6 | email: string; 7 | username: string; 8 | password: string; 9 | created_at: string; 10 | updatedAt: string; 11 | __v: number; 12 | } 13 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/types/user.ts: -------------------------------------------------------------------------------- 1 | export interface User { 2 | email: string; 3 | firstName: string; 4 | // phoneNumber: string; 5 | // password: string; 6 | } 7 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/user/login/login.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LoginComponent } from './login.component'; 4 | 5 | describe('LoginComponent', () => { 6 | let component: LoginComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [LoginComponent] 12 | }); 13 | fixture = TestBed.createComponent(LoginComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/user/login/login.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { UserService } from '../user.service'; 3 | import { Router } from '@angular/router'; 4 | 5 | @Component({ 6 | selector: 'app-login', 7 | templateUrl: './login.component.html', 8 | styleUrls: ['./login.component.css'], 9 | }) 10 | export class LoginComponent { 11 | constructor(private userService: UserService, private router: Router) {} 12 | 13 | login(email: string, password: string): void { 14 | // ToDo: for now we are not handling the data 15 | this.userService.login(); 16 | this.router.navigate(['/']); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/user/profile/profile.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | default user 4 |

User Info:

5 |
6 |

Username:

7 |

Johny

8 |
9 |
10 |

Email:

11 |

john.doe@gmail.com

12 |
13 |
14 |

Phone:

15 |

+359 885 888 888

16 |
17 | 18 |
19 |
20 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/user/profile/profile.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-profile', 5 | templateUrl: './profile.component.html', 6 | styleUrls: ['./profile.component.css'] 7 | }) 8 | export class ProfileComponent { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/user/register/register.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-register', 5 | templateUrl: './register.component.html', 6 | styleUrls: ['./register.component.css'] 7 | }) 8 | export class RegisterComponent { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/user/user.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { LoginComponent } from './login/login.component'; 4 | import { RegisterComponent } from './register/register.component'; 5 | import { ProfileComponent } from './profile/profile.component'; 6 | import { UserRoutingModule } from './user-routing.module'; 7 | 8 | @NgModule({ 9 | declarations: [LoginComponent, RegisterComponent, ProfileComponent], 10 | imports: [CommonModule, UserRoutingModule], 11 | }) 12 | export class UserModule {} 13 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/user/user.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { UserService } from './user.service'; 4 | 5 | describe('UserService', () => { 6 | let service: UserService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(UserService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/app/welcome/welcome.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { UserService } from '../user/user.service'; 3 | 4 | @Component({ 5 | selector: 'app-welcome', 6 | templateUrl: './welcome.component.html', 7 | styleUrls: ['./welcome.component.css'], 8 | }) 9 | export class WelcomeComponent { 10 | constructor(private userService: UserService) {} 11 | 12 | get isLogged(): boolean { 13 | return this.userService.isLogged; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Workshop Modules and Routing/modules-and-routing-workshop/src/assets/.gitkeep -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/assets/profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Workshop Modules and Routing/modules-and-routing-workshop/src/assets/profile.png -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/environments/environment.development.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | appUrl: 'http://localhost:3000/api', 3 | }; 4 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | appUrl: 'http://localhost:3000/api', // domain -> will not be localhost in prod 3 | }; 4 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Workshop Modules and Routing/modules-and-routing-workshop/src/favicon.ico -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/src/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app/app.module'; 4 | 5 | 6 | platformBrowserDynamic().bootstrapModule(AppModule) 7 | .catch(err => console.error(err)); 8 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/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 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/modules-and-routing-workshop/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 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /Workshop Modules and Routing/resources/forum/posts.bson: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Workshop Modules and Routing/resources/forum/posts.bson -------------------------------------------------------------------------------- /Workshop Modules and Routing/resources/forum/posts.metadata.json: -------------------------------------------------------------------------------- 1 | {"options":{},"indexes":[{"v":2,"key":{"_id":1},"name":"_id_","ns":"forum.posts"}],"uuid":"8e8754eadf90424aa5cf5d9e2bfbb48e"} -------------------------------------------------------------------------------- /Workshop Modules and Routing/resources/forum/themes.bson: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Workshop Modules and Routing/resources/forum/themes.bson -------------------------------------------------------------------------------- /Workshop Modules and Routing/resources/forum/themes.metadata.json: -------------------------------------------------------------------------------- 1 | {"options":{},"indexes":[{"v":2,"key":{"_id":1},"name":"_id_","ns":"forum.themes"}],"uuid":"a9e25cd8f9d44ee39d90dc2584bf437d"} -------------------------------------------------------------------------------- /Workshop Modules and Routing/resources/forum/users.bson: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Workshop Modules and Routing/resources/forum/users.bson -------------------------------------------------------------------------------- /Workshop Modules and Routing/resources/forum/users.metadata.json: -------------------------------------------------------------------------------- 1 | {"options":{},"indexes":[{"v":2,"key":{"_id":1},"name":"_id_","ns":"forum.users"},{"v":2,"unique":true,"key":{"email":1},"name":"email_1","ns":"forum.users","background":true},{"v":2,"unique":true,"key":{"username":1},"name":"username_1","ns":"forum.users","background":true}],"uuid":"d1f59d47b68c427eb89196b588247543"} -------------------------------------------------------------------------------- /Workshop Modules and Routing/resources/views/theme-content/profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/Workshop Modules and Routing/resources/views/theme-content/profile.png -------------------------------------------------------------------------------- /Workshop Modules and Routing/resources/views/theme-content/reset.css: -------------------------------------------------------------------------------- 1 | /* 2 | *Removes all default whitespace 3 | */ 4 | 5 | * { 6 | padding: 0; 7 | margin: 0; 8 | } 9 | 10 | /* 11 | *Reset CSS model sizing calculations 12 | */ 13 | 14 | html { 15 | box-sizing: border-box; 16 | } 17 | 18 | *, *:before, *:after { 19 | box-sizing: inherit; 20 | } -------------------------------------------------------------------------------- /Workshop Modules and Routing/resources/views/theme-content/responsive.css: -------------------------------------------------------------------------------- 1 | @media (min-width: 800px) { 2 | html { 3 | font-size: 14px; 4 | } 5 | } 6 | 7 | @media (min-width: 1024px) { 8 | html { 9 | font-size: 16px; 10 | } 11 | } 12 | 13 | @media (min-width: 1280px) { 14 | html { 15 | font-size: 18px; 16 | } 17 | } -------------------------------------------------------------------------------- /firebase-guide-setup.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/firebase-guide-setup.docx -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/.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 | -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://localhost:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://localhost:9876/debug.html" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | 4 | const routes: Routes = []; 5 | 6 | @NgModule({ 7 | imports: [RouterModule.forRoot(routes)], 8 | exports: [RouterModule] 9 | }) 10 | export class AppRoutingModule { } 11 | -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/ngrx/ngrx-test-app/src/app/app.component.css -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |

Hi, there!

4 |
5 | 6 |
7 | 8 |
9 | -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/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 | -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/src/app/post/post.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/ngrx/ngrx-test-app/src/app/post/post.component.css -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/src/app/post/post.component.html: -------------------------------------------------------------------------------- 1 |
2 |

{{ p.text }}

3 |
4 | Likes: 5 |

{{ p.likes }}

6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/src/app/post/post.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { PostComponent } from './post.component'; 4 | 5 | describe('PostComponent', () => { 6 | let component: PostComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [PostComponent] 12 | }); 13 | fixture = TestBed.createComponent(PostComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/src/app/post/post.type.ts: -------------------------------------------------------------------------------- 1 | export interface Post { 2 | likes?: number; 3 | text?: string; 4 | } 5 | 6 | export interface PostState { 7 | post: Post; 8 | } 9 | -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/src/app/redux-simulation/redux-simulation.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/ngrx/ngrx-test-app/src/app/redux-simulation/redux-simulation.component.css -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/src/app/redux-simulation/redux-simulation.component.html: -------------------------------------------------------------------------------- 1 |

redux-simulation works!

2 | -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/src/app/translate/translate.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/ngrx/ngrx-test-app/src/app/translate/translate.component.css -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/src/app/translate/translate.component.html: -------------------------------------------------------------------------------- 1 |
2 | {{ message$ | async }} 3 |
4 |
5 | 6 | 7 |
8 | -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/src/app/translate/translate.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TranslateComponent } from './translate.component'; 4 | 5 | describe('TranslateComponent', () => { 6 | let component: TranslateComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [TranslateComponent] 12 | }); 13 | fixture = TestBed.createComponent(TranslateComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/src/app/translate/translate.reducer.ts: -------------------------------------------------------------------------------- 1 | import { Action } from '@ngrx/store'; 2 | 3 | export function translateReducer(state: string = 'Hello!', action: Action) { 4 | console.log(action.type, state); 5 | 6 | switch (action.type) { 7 | case 'BULGARIAN': 8 | return (state = 'Zdrasti!'); 9 | case 'ITALIAN': 10 | return (state = 'Ciao!'); 11 | 12 | default: 13 | return state; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/src/app/translate/translate.type.ts: -------------------------------------------------------------------------------- 1 | export interface TranslateState { 2 | message: string; 3 | } 4 | -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/ngrx/ngrx-test-app/src/assets/.gitkeep -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/ngrx/ngrx-test-app/src/favicon.ico -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NgrxTestApp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/src/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app/app.module'; 4 | 5 | 6 | platformBrowserDynamic().bootstrapModule(AppModule) 7 | .catch(err => console.error(err)); 8 | -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/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 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /ngrx/ngrx-test-app/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 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/.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 | -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://localhost:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://localhost:9876/debug.html" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/pipes and subjects/pipes-and-subjects/src/app/app.component.css -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/src/app/constants.ts: -------------------------------------------------------------------------------- 1 | // env prod 2 | // export const API_URL = 'https://jsonplaceholder.typicode.com'; 3 | 4 | // env dev 5 | export const API_URL = 'https://jsonplaceholder.typicode.com'; 6 | -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/src/app/home/home.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/pipes and subjects/pipes-and-subjects/src/app/home/home.component.css -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 |

home works!

2 | -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HomeComponent } from './home.component'; 4 | 5 | describe('HomeComponent', () => { 6 | let component: HomeComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [HomeComponent] 12 | }); 13 | fixture = TestBed.createComponent(HomeComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } 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 { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/src/app/lazy/lazy.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { LazyComponent } from './lazy/lazy.component'; 4 | import { LazyRoutingModule } from './lazy.router'; 5 | 6 | @NgModule({ 7 | declarations: [LazyComponent], 8 | imports: [CommonModule, LazyRoutingModule], 9 | }) 10 | export class LazyModule {} 11 | -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/src/app/lazy/lazy.router.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | import { LazyComponent } from './lazy/lazy.component'; 4 | 5 | const routes: Routes = [ 6 | { 7 | path: '', 8 | pathMatch: 'full', 9 | component: LazyComponent, 10 | }, 11 | ]; 12 | 13 | @NgModule({ 14 | imports: [RouterModule.forChild(routes)], 15 | exports: [RouterModule], 16 | }) 17 | export class LazyRoutingModule {} 18 | -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/src/app/lazy/lazy/lazy.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/pipes and subjects/pipes-and-subjects/src/app/lazy/lazy/lazy.component.css -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/src/app/lazy/lazy/lazy.component.html: -------------------------------------------------------------------------------- 1 |

lazy works!

2 | -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/src/app/lazy/lazy/lazy.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LazyComponent } from './lazy.component'; 4 | 5 | describe('LazyComponent', () => { 6 | let component: LazyComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [LazyComponent] 12 | }); 13 | fixture = TestBed.createComponent(LazyComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/src/app/lazy/lazy/lazy.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-lazy', 5 | templateUrl: './lazy.component.html', 6 | styleUrls: ['./lazy.component.css'] 7 | }) 8 | export class LazyComponent { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/src/app/reduce.pipe.spec.ts: -------------------------------------------------------------------------------- 1 | import { ReducePipe } from './reduce.pipe'; 2 | 3 | describe('ReducePipe', () => { 4 | it('create an instance', () => { 5 | const pipe = new ReducePipe(); 6 | expect(pipe).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/src/app/reduce.pipe.ts: -------------------------------------------------------------------------------- 1 | import { Pipe, PipeTransform } from '@angular/core'; 2 | 3 | @Pipe({ 4 | name: 'reduce', 5 | // pure: false => not pure function will re-render 6 | // pure: true => pure function will be memoized // DEFAULT 7 | }) 8 | export class ReducePipe implements PipeTransform { 9 | transform( 10 | array: T[], 11 | reduceFn: (acc: any, curr: T) => any, 12 | initialValue: T 13 | ): unknown { 14 | return array.reduce(reduceFn, initialValue); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/src/app/user.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { UserService } from './user.service'; 4 | 5 | describe('UserService', () => { 6 | let service: UserService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(UserService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/pipes and subjects/pipes-and-subjects/src/assets/.gitkeep -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/pipes and subjects/pipes-and-subjects/src/favicon.ico -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PipesAndSubjects 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/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 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /pipes and subjects/pipes-and-subjects/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 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/.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 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "name": "ng serve", 7 | "type": "chrome", 8 | "request": "launch", 9 | "preLaunchTask": "npm: start", 10 | "url": "http://localhost:4200/" 11 | }, 12 | { 13 | "name": "ng test", 14 | "type": "chrome", 15 | "request": "launch", 16 | "preLaunchTask": "npm: test", 17 | "url": "http://localhost:9876/debug.html" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/api.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { ApiService } from './api.service'; 4 | 5 | describe('ApiService', () => { 6 | let service: ApiService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(ApiService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/workshop pipes and subjects/workshop-pipes/src/app/app.component.css -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-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 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/authenticate/authenticate.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/workshop pipes and subjects/workshop-pipes/src/app/authenticate/authenticate.component.css -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/authenticate/authenticate.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/core/core.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { HeaderComponent } from './header/header.component'; 4 | import { FooterComponent } from './footer/footer.component'; 5 | import { RouterModule } from '@angular/router'; 6 | import { ErrorComponent } from './error/error.component'; 7 | 8 | @NgModule({ 9 | declarations: [HeaderComponent, FooterComponent, ErrorComponent], 10 | imports: [CommonModule, RouterModule], 11 | // Note: tells which components to be exported from this module 12 | exports: [HeaderComponent, FooterComponent], 13 | }) 14 | export class CoreModule {} 15 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/core/error/error.component.css: -------------------------------------------------------------------------------- 1 | .notification { 2 | position: fixed; 3 | z-index: 10; 4 | right: 40%; 5 | top: 10%; 6 | padding: 0.5rem; 7 | border-radius: 0.5rem; 8 | color: rgb(255, 255, 255); 9 | font-style: italic; 10 | text-decoration: underline; 11 | box-shadow: 0 5px 10px rgb(204, 204, 204); 12 | background-color: rgba(238, 74, 74, 0.699); 13 | } 14 | 15 | .error-message { 16 | background-color: rgba(238, 74, 74, 0.699); 17 | } 18 | 19 | .success-message { 20 | background-color: rgba(99, 230, 81, 0.699); 21 | } 22 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/core/error/error.component.html: -------------------------------------------------------------------------------- 1 |

2 | {{ errorMsg }} 3 |

4 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/core/error/error.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ErrorComponent } from './error.component'; 4 | 5 | describe('ErrorComponent', () => { 6 | let component: ErrorComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ErrorComponent] 12 | }); 13 | fixture = TestBed.createComponent(ErrorComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/core/error/error.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ErrorService } from './error.service'; 3 | 4 | @Component({ 5 | selector: 'app-error', 6 | templateUrl: './error.component.html', 7 | styleUrls: ['./error.component.css'], 8 | }) 9 | export class ErrorComponent implements OnInit { 10 | apiError$ = this.errorService.apiError$$.asObservable(); 11 | errorMsg = ''; 12 | 13 | constructor(private errorService: ErrorService) {} 14 | 15 | ngOnInit(): void { 16 | this.apiError$.subscribe((err: any) => { 17 | this.errorMsg = err.message; 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/core/error/error.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { ErrorService } from './error.service'; 4 | 5 | describe('ErrorService', () => { 6 | let service: ErrorService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(ErrorService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/core/error/error.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { BehaviorSubject } from 'rxjs'; 3 | 4 | @Injectable({ 5 | providedIn: 'root', 6 | }) 7 | export class ErrorService { 8 | apiError$$ = new BehaviorSubject(null); 9 | constructor() {} 10 | 11 | setError(error: any): void { 12 | this.apiError$$.next(error); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/core/footer/footer.component.css: -------------------------------------------------------------------------------- 1 | /* footer */ 2 | footer { 3 | background: rgb(0, 212, 255); 4 | margin-top: 1em; 5 | position: absolute; 6 | bottom: 0; 7 | width: 100%; 8 | max-width: 1366px; 9 | } 10 | 11 | footer p { 12 | margin: 0; 13 | padding: 0; 14 | font-size: 0.7em; 15 | text-align: center; 16 | } 17 | 18 | footer span { 19 | font-size: 1.5em; 20 | } 21 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/core/footer/footer.component.html: -------------------------------------------------------------------------------- 1 |
2 |

This site is designed to be used for training purposes at SoftUni.

3 |

You can find the real SoftUni forum at this link:

4 |

5 | https://softuni.bg/forum 6 | Angular course Copyright © 2020 7 |

8 |
9 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/core/footer/footer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FooterComponent } from './footer.component'; 4 | 5 | describe('FooterComponent', () => { 6 | let component: FooterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [FooterComponent] 12 | }); 13 | fixture = TestBed.createComponent(FooterComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/core/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-footer', 5 | templateUrl: './footer.component.html', 6 | styleUrls: ['./footer.component.css'] 7 | }) 8 | export class FooterComponent { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/core/header/header.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeaderComponent } from './header.component'; 4 | 5 | describe('HeaderComponent', () => { 6 | let component: HeaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [HeaderComponent] 12 | }); 13 | fixture = TestBed.createComponent(HeaderComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/home/home.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/workshop pipes and subjects/workshop-pipes/src/app/home/home.component.css -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HomeComponent } from './home.component'; 4 | 5 | describe('HomeComponent', () => { 6 | let component: HomeComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [HomeComponent] 12 | }); 13 | fixture = TestBed.createComponent(HomeComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { UserService } from '../user/user.service'; 3 | 4 | @Component({ 5 | selector: 'app-home', 6 | templateUrl: './home.component.html', 7 | styleUrls: ['./home.component.css'], 8 | }) 9 | export class HomeComponent {} 10 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/main/main.component.css: -------------------------------------------------------------------------------- 1 | /* main */ 2 | main { 3 | width: 50%; 4 | } 5 | 6 | .container { 7 | width: 90%; 8 | margin: auto; 9 | padding-bottom: 4.5em; 10 | display: flex; 11 | align-items: flex-start; 12 | justify-content: space-evenly; 13 | } 14 | 15 | aside { 16 | width: 29%; 17 | margin-top: 1em; 18 | font-size: 0.8em; 19 | } 20 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/main/main.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/main/main.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { MainComponent } from './main.component'; 4 | 5 | describe('MainComponent', () => { 6 | let component: MainComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [MainComponent] 12 | }); 13 | fixture = TestBed.createComponent(MainComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/main/main.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-main', 5 | templateUrl: './main.component.html', 6 | styleUrls: ['./main.component.css'], 7 | }) 8 | export class MainComponent {} 9 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/not-found/not-found.component.html: -------------------------------------------------------------------------------- 1 |
2 |
4
3 | 4 |
4
5 |
6 | Ooops! Page Not Found 7 |

Let's go home and try from there.

8 |
9 |
10 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/not-found/not-found.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-not-found', 5 | templateUrl: './not-found.component.html', 6 | styleUrls: ['./not-found.component.css'], 7 | }) 8 | export class NotFoundComponent {} 9 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/shared/constants.ts: -------------------------------------------------------------------------------- 1 | export const DEFAULT_EMAIL_DOMAINS = ["bg", "com"]; 2 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/shared/loader/loader.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/workshop pipes and subjects/workshop-pipes/src/app/shared/loader/loader.component.css -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/shared/loader/loader.component.html: -------------------------------------------------------------------------------- 1 |
Loading...
2 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/shared/loader/loader.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-loader', 5 | templateUrl: './loader.component.html', 6 | styleUrls: ['./loader.component.css'], 7 | }) 8 | export class LoaderComponent {} 9 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/shared/pipes/elapsed-time.pipe.spec.ts: -------------------------------------------------------------------------------- 1 | import { ElapsedTimePipe } from './elapsed-time.pipe'; 2 | 3 | describe('ElapsedTimePipe', () => { 4 | it('create an instance', () => { 5 | const pipe = new ElapsedTimePipe(); 6 | expect(pipe).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/shared/pipes/elapsed-time.pipe.ts: -------------------------------------------------------------------------------- 1 | import { Pipe, PipeTransform } from '@angular/core'; 2 | import * as moment from 'moment'; 3 | 4 | @Pipe({ 5 | name: 'elapsedTime', 6 | }) 7 | export class ElapsedTimePipe implements PipeTransform { 8 | transform(dateString: string, ...args: unknown[]): unknown { 9 | // date from the posts from today's date 10 | return moment(dateString).fromNow(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/shared/pipes/slice.pipe.spec.ts: -------------------------------------------------------------------------------- 1 | import { SlicePipe } from './slice.pipe'; 2 | 3 | describe('SlicePipe', () => { 4 | it('create an instance', () => { 5 | const pipe = new SlicePipe(); 6 | expect(pipe).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/shared/pipes/slice.pipe.ts: -------------------------------------------------------------------------------- 1 | import { Pipe, PipeTransform } from '@angular/core'; 2 | 3 | @Pipe({ 4 | name: 'slice', 5 | }) 6 | export class SlicePipe implements PipeTransform { 7 | transform(value: string, maxCharCount = 5): unknown { 8 | return `${value.substring(0, maxCharCount)}${ 9 | value.length > maxCharCount ? '...' : '' 10 | }`; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/shared/shared.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { LoaderComponent } from './loader/loader.component'; 4 | import { AppEmailDirective } from './validators/app-email.directive'; 5 | import { SlicePipe } from './pipes/slice.pipe'; 6 | import { ElapsedTimePipe } from './pipes/elapsed-time.pipe'; 7 | 8 | @NgModule({ 9 | declarations: [ 10 | LoaderComponent, 11 | AppEmailDirective, 12 | SlicePipe, 13 | ElapsedTimePipe, 14 | ], 15 | imports: [CommonModule], 16 | exports: [LoaderComponent, AppEmailDirective, SlicePipe, ElapsedTimePipe], 17 | }) 18 | export class SharedModule {} 19 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/shared/validators/app-email-validator.ts: -------------------------------------------------------------------------------- 1 | import { ValidatorFn } from "@angular/forms"; 2 | 3 | export function appEmailValidator(domains: string[]): ValidatorFn { 4 | const domainStrings = domains.join("|"); // ['bg', 'com'] => bg|com 5 | const regExp = new RegExp(`[^@]{6,}@gmail\.(${domainStrings})$`); 6 | 7 | return (control) => { 8 | const x = control.value; 9 | const z = regExp.test(control.value); 10 | return control.value === "" || regExp.test(control.value) 11 | ? null 12 | : { appEmailValidator: true }; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/shared/validators/app-email.directive.spec.ts: -------------------------------------------------------------------------------- 1 | import { AppEmailDirective } from './app-email.directive'; 2 | 3 | describe('AppEmailDirective', () => { 4 | it('should create an instance', () => { 5 | const directive = new AppEmailDirective(); 6 | expect(directive).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/shared/validators/match-passwords-validator.ts: -------------------------------------------------------------------------------- 1 | import { FormGroup, ValidatorFn } from "@angular/forms"; 2 | 3 | export function matchPasswordsValidator( 4 | passwordCtrlOne: string, 5 | passwordCtrlTwo: string 6 | ): ValidatorFn { 7 | return (control) => { 8 | const group = control as FormGroup; 9 | const passCtrl1 = group.get(passwordCtrlOne); 10 | const passCtrl2 = group.get(passwordCtrlTwo); 11 | 12 | return passCtrl1?.value === passCtrl2?.value 13 | ? null 14 | : { matchPasswordsValidator: true }; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/theme/theme.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from "@angular/core"; 2 | import { CommonModule } from "@angular/common"; 3 | import { NewThemeComponent } from "./new-theme/new-theme.component"; 4 | import { CurrentThemeComponent } from "./current-theme/current-theme.component"; 5 | import { ThemeRoutingModule } from "./theme-routing.module"; 6 | import { FormsModule } from "@angular/forms"; 7 | 8 | @NgModule({ 9 | declarations: [NewThemeComponent, CurrentThemeComponent], 10 | imports: [CommonModule, ThemeRoutingModule, FormsModule], 11 | }) 12 | export class ThemeModule {} 13 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/types/post.ts: -------------------------------------------------------------------------------- 1 | import { Theme } from './theme'; 2 | import { UserId } from './user-id'; 3 | 4 | export interface Post { 5 | likes: string[]; 6 | _id: string; 7 | text: string; 8 | userId: UserId; 9 | themeId: Theme; 10 | created_at: string; 11 | updatedAt: string; 12 | __v: number; 13 | } 14 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/types/theme.ts: -------------------------------------------------------------------------------- 1 | import { Post } from './post'; 2 | import { UserId } from './user-id'; 3 | 4 | export interface Theme { 5 | subscribers: string[]; 6 | posts: any; // string[] | Post[]; 7 | _id: string; 8 | themeName: string; 9 | userId: UserId; 10 | created_at: string; 11 | updatedAt: string; 12 | __v: number; 13 | } 14 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/types/user-id.ts: -------------------------------------------------------------------------------- 1 | export interface UserId { 2 | themes: string[]; 3 | posts: string[]; 4 | _id: string; 5 | tel: string; 6 | email: string; 7 | username: string; 8 | password: string; 9 | created_at: string; 10 | updatedAt: string; 11 | __v: number; 12 | } 13 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/types/user.ts: -------------------------------------------------------------------------------- 1 | export interface User { 2 | email: string; 3 | firstName: string; 4 | username: string; 5 | tel: string; 6 | // phoneNumber: string; 7 | // password: string; 8 | } 9 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/user/login/login.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LoginComponent } from './login.component'; 4 | 5 | describe('LoginComponent', () => { 6 | let component: LoginComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [LoginComponent] 12 | }); 13 | fixture = TestBed.createComponent(LoginComponent); 14 | component = fixture.componentInstance; 15 | fixture.detectChanges(); 16 | }); 17 | 18 | it('should create', () => { 19 | expect(component).toBeTruthy(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/user/user.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | 3 | import { UserService } from './user.service'; 4 | 5 | describe('UserService', () => { 6 | let service: UserService; 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({}); 10 | service = TestBed.inject(UserService); 11 | }); 12 | 13 | it('should be created', () => { 14 | expect(service).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/app/welcome/welcome.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { UserService } from '../user/user.service'; 3 | 4 | @Component({ 5 | selector: 'app-welcome', 6 | templateUrl: './welcome.component.html', 7 | styleUrls: ['./welcome.component.css'], 8 | }) 9 | export class WelcomeComponent { 10 | constructor(private userService: UserService) {} 11 | 12 | get isLogged(): boolean { 13 | return this.userService.isLogged; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/workshop pipes and subjects/workshop-pipes/src/assets/.gitkeep -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/assets/profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/workshop pipes and subjects/workshop-pipes/src/assets/profile.png -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/environments/environment.development.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | apiUrl: 'http://localhost:3000/api', 3 | }; 4 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | apiUrl: 'http://localhost:3000/api', // domain -> will not be localhost in prod 3 | }; 4 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsvetis/Angular-June-2023/71c5f420387dab2f23f5dfb72de4040c95dd83ae/workshop pipes and subjects/workshop-pipes/src/favicon.ico -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/src/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app/app.module'; 4 | 5 | 6 | platformBrowserDynamic().bootstrapModule(AppModule) 7 | .catch(err => console.error(err)); 8 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/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 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /workshop pipes and subjects/workshop-pipes/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 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | --------------------------------------------------------------------------------