diff --git a/.editorconfig b/.editorconfig index f6f117cb..6e87a003 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,13 +1,13 @@ -# Editor configuration, see http://editorconfig.org -root = true - -[*] -charset = utf-8 -indent_style = space -indent_size = 2 -insert_final_newline = true -trim_trailing_whitespace = true - -[*.md] -max_line_length = off -trim_trailing_whitespace = false +# Editor configuration, see http://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +max_line_length = off +trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore index 60989406..eabf65e5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,42 +1,44 @@ -# See http://help.github.com/ignore-files/ for more about ignoring files. - -# compiled output -/dist -/tmp -/out-tsc - -# dependencies -/node_modules - -# IDEs and editors -/.idea -.project -.classpath -.c9/ -*.launch -.settings/ -*.sublime-workspace - -# IDE - VSCode -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json - -# misc -/.sass-cache -/connect.lock -/coverage -/libpeerconnection.log -npm-debug.log -testem.log -/typings - -# e2e -/e2e/*.js -/e2e/*.map - -# System Files -.DS_Store -Thumbs.db +# See http://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist +/dist-server +/tmp +/out-tsc + +# dependencies +/node_modules + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# misc +/.sass-cache +/connect.lock +/coverage +/libpeerconnection.log +npm-debug.log +yarn-error.log +testem.log +/typings + +# e2e +/e2e/*.js +/e2e/*.map + +# System Files +.DS_Store +Thumbs.db diff --git a/README.md b/README.md index 3cd9e1c6..e55bfbb1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Angular2+ - ShoppingCart +# Angular5 - ShoppingCart [![HitCount](http://hits.dwyl.io/ikismail/Angular4-ShoppingCart.svg)](http://hits.dwyl.io/ikismail/Angular4-ShoppingCart) @@ -7,11 +7,11 @@ [![GitHub issues](https://img.shields.io/github/issues/ikismail/Angular4-ShoppingCart.svg)](https://github.com/ikismail/Angular4-ShoppingCart/issues) [![](https://img.shields.io/github/release/ikismail/Angular4-ShoppingCart.svg?style=flat-square)](https://github.com/ikismail/Angular4-ShoppingCart/releases) -Developing a **ShoppingCart (Ecommerce) Application using Angular2+**. +Developing a **ShoppingCart (Ecommerce) Application using Angular5**. **Live Demo** : [angular4-shopping-cart](https://angular4-shopping-cart.herokuapp.com/) -This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.5.4. +This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.7.4. ## Functionalities @@ -28,7 +28,7 @@ This project was generated with [Angular CLI](https://github.com/angular/angular ## Tools and Technologies -* Technology: HTML, MDBootstrap, CSS, Angular2+, Firebase, Charts, Progressive Web Application. +* Technology: HTML, MDBootstrap, CSS, Angular-5, Firebase, Charts, Progressive Web Application. * Database : Angular Firebase. #### This Projects covers all fundamentals of Angular diff --git a/e2e/app.e2e-spec.ts b/e2e/app.e2e-spec.ts index 5f645936..e1c667aa 100644 --- a/e2e/app.e2e-spec.ts +++ b/e2e/app.e2e-spec.ts @@ -1,14 +1,14 @@ -import { AppPage } from './app.po'; - -describe('angular4-shopping-cart App', () => { - let page: AppPage; - - beforeEach(() => { - page = new AppPage(); - }); - - it('should display welcome message', () => { - page.navigateTo(); - expect(page.getParagraphText()).toEqual('Welcome to app!'); - }); -}); +import { AppPage } from "./app.po"; + +describe("angular-shop App", () => { + let page: AppPage; + + beforeEach(() => { + page = new AppPage(); + }); + + it("should display welcome message", () => { + page.navigateTo(); + expect(page.getParagraphText()).toEqual("Welcome to app!"); + }); +}); diff --git a/e2e/app.po.ts b/e2e/app.po.ts index 625420f7..636bd363 100644 --- a/e2e/app.po.ts +++ b/e2e/app.po.ts @@ -1,11 +1,11 @@ -import { browser, by, element } from 'protractor'; - -export class AppPage { - navigateTo() { - return browser.get('/'); - } - - getParagraphText() { - return element(by.css('app-root h1')).getText(); - } -} +import { browser, by, element } from "protractor"; + +export class AppPage { + navigateTo() { + return browser.get("/"); + } + + getParagraphText() { + return element(by.css("app-root h1")).getText(); + } +} diff --git a/e2e/tsconfig.e2e.json b/e2e/tsconfig.e2e.json index 3cd8f8ef..1d9e5edf 100644 --- a/e2e/tsconfig.e2e.json +++ b/e2e/tsconfig.e2e.json @@ -1,14 +1,14 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "outDir": "../out-tsc/e2e", - "baseUrl": "./", - "module": "commonjs", - "target": "es5", - "types": [ - "jasmine", - "jasminewd2", - "node" - ] - } -} +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/e2e", + "baseUrl": "./", + "module": "commonjs", + "target": "es5", + "types": [ + "jasmine", + "jasminewd2", + "node" + ] + } +} diff --git a/karma.conf.js b/karma.conf.js index 3efd404b..af139fad 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,33 +1,33 @@ -// Karma configuration file, see link for more information -// https://karma-runner.github.io/1.0/config/configuration-file.html - -module.exports = function (config) { - config.set({ - basePath: '', - frameworks: ['jasmine', '@angular/cli'], - plugins: [ - require('karma-jasmine'), - require('karma-chrome-launcher'), - require('karma-jasmine-html-reporter'), - require('karma-coverage-istanbul-reporter'), - require('@angular/cli/plugins/karma') - ], - client:{ - clearContext: false // leave Jasmine Spec Runner output visible in browser - }, - coverageIstanbulReporter: { - reports: [ 'html', 'lcovonly' ], - fixWebpackSourcePaths: true - }, - angularCli: { - environment: 'dev' - }, - reporters: ['progress', 'kjhtml'], - port: 9876, - colors: true, - logLevel: config.LOG_INFO, - autoWatch: true, - browsers: ['Chrome'], - singleRun: false - }); -}; +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +module.exports = function (config) { + config.set({ + basePath: '', + frameworks: ['jasmine', '@angular/cli'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-coverage-istanbul-reporter'), + require('@angular/cli/plugins/karma') + ], + client:{ + clearContext: false // leave Jasmine Spec Runner output visible in browser + }, + coverageIstanbulReporter: { + reports: [ 'html', 'lcovonly' ], + fixWebpackSourcePaths: true + }, + angularCli: { + environment: 'dev' + }, + reporters: ['progress', 'kjhtml'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['Chrome'], + singleRun: false + }); +}; diff --git a/package.json b/package.json index c5b686d9..922301c3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "angular4-shopping-cart", - "version": "0.0.0", + "name": "angular-shop", + "version": "0.1.0", "license": "MIT", "scripts": { "ng": "ng", @@ -20,60 +20,59 @@ "private": true, "dependencies": { "@agm/core": "^1.0.0-beta.2", - "@angular/animations": "^4.2.4", - "@angular/cli": "1.4.9", - "@angular/common": "^4.2.4", - "@angular/compiler": "^4.2.4", - "@angular/compiler-cli": "^4.2.4", - "@angular/core": "^4.2.4", - "@angular/forms": "^4.2.4", - "@angular/http": "^4.2.4", - "@angular/platform-browser": "^4.2.4", - "@angular/platform-browser-dynamic": "^4.2.4", - "@angular/router": "^4.2.4", + "@angular/animations": "^5.2.0", + "@angular/cli": "~1.7.3", + "@angular/common": "^5.2.0", + "@angular/compiler": "^5.2.0", + "@angular/compiler-cli": "^5.2.0", + "@angular/core": "^5.2.0", + "@angular/forms": "^5.2.0", + "@angular/http": "^5.2.0", + "@angular/platform-browser": "^5.2.0", + "@angular/platform-browser-dynamic": "^5.2.0", + "@angular/router": "^5.2.0", "angular-bootstrap-md": "^5.0.5", - "angular2-toaster": "^4.0.1", + "angular2-toaster": "^5.0.1", "angularfire2": "5.0.0-rc.3", - "animate.css": "^3.5.2", - "bootstrap": "^3.3.7", + "animate.css": "^3.6.1", + "bootstrap": "^4.1.1", "core-js": "^2.4.1", - "express": "^4.16.2", + "express": "^4.16.3", "firebase": "4.6.0", "font-awesome": "^4.7.0", - "jquery": "^3.2.1", + "jquery": "^3.3.1", "moment": "^2.22.1", - "ng2-owl-carousel": "^0.1.15", "ng2-toasty": "^4.0.3", - "ngx-pagination": "^3.0.3", - "node-sass": "^4.8.3", - "owl.carousel": "^2.2.0", - "primeng": "^5.0.2", - "rxjs": "^5.4.2", + "ngx-owl-carousel": "^2.0.7", + "ngx-pagination": "^3.1.1", + "node-sass": "^4.9.0", + "owl.carousel": "^2.3.4", + "primeng": "^5.2.5", + "rxjs": "^5.5.6", "shortid": "^2.2.8", - "tether": "^1.4.1", - "typescript": "~2.4.2", - "zone.js": "^0.8.14" + "tether": "^1.4.4", + + "zone.js": "^0.8.19" }, "devDependencies": { - "@angular/cli": "1.4.9", - "@angular/compiler-cli": "^4.2.4", - "@angular/language-service": "^4.2.4", - "@types/jasmine": "~2.5.53", + "@angular/cli": "~1.7.3", + "@angular/compiler-cli": "^5.2.0", + "@angular/language-service": "^5.2.0", + "@types/jasmine": "~2.8.3", "@types/jasminewd2": "~2.0.2", "@types/node": "~6.0.60", "codelyzer": "^4.0.1", - "jasmine-core": "~2.6.2", - "jasmine-spec-reporter": "~4.1.0", - "karma": "~1.7.0", - "karma-chrome-launcher": "~2.1.1", - "karma-cli": "~1.0.1", + "jasmine-core": "~2.8.0", + "jasmine-spec-reporter": "~4.2.1", + "karma": "~2.0.0", + "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "^1.2.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "~5.1.2", - "ts-node": "~3.2.0", - "tslint": "~5.7.0", - "typescript": "~2.4.2", - "webpack": "^3.10.0" + "ts-node": "~4.1.0", + "tslint": "~5.9.1", + "typescript": "~2.5.3", + "webpack": "^4.6.0" } } diff --git a/protractor.conf.js b/protractor.conf.js index b1a56c18..7ee3b5ee 100644 --- a/protractor.conf.js +++ b/protractor.conf.js @@ -1,28 +1,28 @@ -// Protractor configuration file, see link for more information -// https://github.com/angular/protractor/blob/master/lib/config.ts - -const { SpecReporter } = require('jasmine-spec-reporter'); - -exports.config = { - allScriptsTimeout: 11000, - specs: [ - './e2e/**/*.e2e-spec.ts' - ], - capabilities: { - 'browserName': 'chrome' - }, - directConnect: true, - baseUrl: 'http://localhost:4200/', - framework: 'jasmine', - jasmineNodeOpts: { - showColors: true, - defaultTimeoutInterval: 30000, - print: function() {} - }, - onPrepare() { - require('ts-node').register({ - project: 'e2e/tsconfig.e2e.json' - }); - jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); - } -}; +// Protractor configuration file, see link for more information +// https://github.com/angular/protractor/blob/master/lib/config.ts + +const { SpecReporter } = require('jasmine-spec-reporter'); + +exports.config = { + allScriptsTimeout: 11000, + specs: [ + './e2e/**/*.e2e-spec.ts' + ], + capabilities: { + 'browserName': 'chrome' + }, + directConnect: true, + baseUrl: 'http://localhost:4200/', + framework: 'jasmine', + jasmineNodeOpts: { + showColors: true, + defaultTimeoutInterval: 30000, + print: function() {} + }, + onPrepare() { + require('ts-node').register({ + project: 'e2e/tsconfig.e2e.json' + }); + jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); + } +}; diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts new file mode 100644 index 00000000..be638c7d --- /dev/null +++ b/src/app/app.component.spec.ts @@ -0,0 +1,27 @@ +import { TestBed, async } from "@angular/core/testing"; +import { AppComponent } from "./app.component"; +describe("AppComponent", () => { + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [AppComponent] + }).compileComponents(); + })); + it("should create the app", async(() => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.debugElement.componentInstance; + expect(app).toBeTruthy(); + })); + it(`should have as title 'app'`, async(() => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.debugElement.componentInstance; + expect(app.title).toEqual("app"); + })); + it("should render title in a h1 tag", async(() => { + const fixture = TestBed.createComponent(AppComponent); + fixture.detectChanges(); + const compiled = fixture.debugElement.nativeElement; + expect(compiled.querySelector("h1").textContent).toContain( + "Welcome to app!" + ); + })); +}); diff --git a/src/app/product/product.module.ts b/src/app/product/product.module.ts index 4158514b..09849f47 100644 --- a/src/app/product/product.module.ts +++ b/src/app/product/product.module.ts @@ -7,7 +7,7 @@ import { RouterModule } from "@angular/router"; // Third Party Dependencies import { NgxPaginationModule } from "ngx-pagination"; -import { OwlModule } from "ng2-owl-carousel"; +import { OwlModule } from "ngx-owl-carousel"; import { ToastyModule } from "ng2-toasty"; // configuration and services diff --git a/src/app/user/user.component.html b/src/app/user/user.component.html index 45159f74..56291313 100644 --- a/src/app/user/user.component.html +++ b/src/app/user/user.component.html @@ -6,7 +6,7 @@