├── .angular-cli.json ├── .editorconfig ├── .gitignore ├── .vscode └── settings.json ├── README.md ├── api ├── .gitignore ├── app.js ├── bin │ └── www ├── models │ └── Book.js ├── package-lock.json ├── package.json ├── routes │ └── book.js └── views │ ├── error.jade │ ├── index.jade │ └── layout.jade ├── e2e ├── app.e2e-spec.ts ├── app.po.ts └── tsconfig.e2e.json ├── karma.conf.js ├── package.json ├── protractor.conf.js ├── proxy.conf.json ├── public ├── favicon.ico ├── index.html ├── inline.bundle.js ├── inline.bundle.js.map ├── main.bundle.js ├── main.bundle.js.map ├── polyfills.bundle.js ├── polyfills.bundle.js.map ├── styles.bundle.js ├── styles.bundle.js.map ├── vendor.bundle.js └── vendor.bundle.js.map ├── src ├── app │ ├── app.component.css │ ├── app.component.html │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.module.ts │ ├── book-create │ │ ├── book-create.component.css │ │ ├── book-create.component.html │ │ ├── book-create.component.spec.ts │ │ └── book-create.component.ts │ ├── book-detail │ │ ├── book-detail.component.css │ │ ├── book-detail.component.html │ │ ├── book-detail.component.spec.ts │ │ └── book-detail.component.ts │ ├── book-edit │ │ ├── book-edit.component.css │ │ ├── book-edit.component.html │ │ ├── book-edit.component.spec.ts │ │ └── book-edit.component.ts │ └── book │ │ ├── book.component.css │ │ ├── book.component.html │ │ ├── book.component.spec.ts │ │ └── book.component.ts ├── assets │ └── .gitkeep ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── favicon.ico ├── index.html ├── main.ts ├── polyfills.ts ├── styles.css ├── test.ts ├── tsconfig.app.json ├── tsconfig.spec.json └── typings.d.ts ├── tsconfig.json └── tslint.json /.angular-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "project": { 4 | "name": "mean-stack" 5 | }, 6 | "apps": [ 7 | { 8 | "root": "src", 9 | "outDir": "dist", 10 | "assets": [ 11 | "assets", 12 | "favicon.ico" 13 | ], 14 | "index": "index.html", 15 | "main": "main.ts", 16 | "polyfills": "polyfills.ts", 17 | "test": "test.ts", 18 | "tsconfig": "tsconfig.app.json", 19 | "testTsconfig": "tsconfig.spec.json", 20 | "prefix": "app", 21 | "styles": [ 22 | "styles.css" 23 | ], 24 | "scripts": [], 25 | "environmentSource": "environments/environment.ts", 26 | "environments": { 27 | "dev": "environments/environment.ts", 28 | "prod": "environments/environment.prod.ts" 29 | } 30 | } 31 | ], 32 | "e2e": { 33 | "protractor": { 34 | "config": "./protractor.conf.js" 35 | } 36 | }, 37 | "lint": [ 38 | { 39 | "project": "src/tsconfig.app.json", 40 | "exclude": "**/node_modules/**" 41 | }, 42 | { 43 | "project": "src/tsconfig.spec.json", 44 | "exclude": "**/node_modules/**" 45 | }, 46 | { 47 | "project": "e2e/tsconfig.e2e.json", 48 | "exclude": "**/node_modules/**" 49 | } 50 | ], 51 | "test": { 52 | "karma": { 53 | "config": "./karma.conf.js" 54 | } 55 | }, 56 | "defaults": { 57 | "styleExt": "css", 58 | "component": {} 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | testem.log 34 | /typings 35 | 36 | # e2e 37 | /e2e/*.js 38 | /e2e/*.map 39 | 40 | # System Files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "git.ignoreLimitWarning": true 3 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Requirement 2 | Node JS, MongoDb, angular CLI 3 | 4 | ## Project setup 5 | run "npm install" at root 6 | cd /api then "npm install" 7 | 8 | ## MeanStack 9 | 10 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.6.1. 11 | 12 | ## Development server 13 | 14 | Run `npm start` for a dev server it will Navigate to `http://localhost:4200/` on browser and run mongo on http://localhost:3000 with help of proxy.conf.json 15 | 16 | ## Code scaffolding 17 | 18 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 19 | 20 | 21 | ## Running unit tests 22 | 23 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). -------------------------------------------------------------------------------- /api/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | testem.log 34 | /typings 35 | 36 | # e2e 37 | /e2e/*.js 38 | /e2e/*.map 39 | 40 | # System Files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /api/app.js: -------------------------------------------------------------------------------- 1 | /*jshint esversion: 6 */ 2 | var express = require('express'); 3 | var path = require('path'); 4 | var favicon = require('serve-favicon'); 5 | var logger = require('morgan'); 6 | var bodyParser = require('body-parser'); 7 | 8 | var book = require('./routes/book'); 9 | var app = express(); 10 | 11 | // view engine setup 12 | // app.set('views', path.join(__dirname, 'views')); 13 | // app.set('view engine', 'jade'); 14 | 15 | 16 | var mongoose = require('mongoose'); 17 | mongoose.Promise = require('bluebird'); 18 | mongoose.connect('mongodb://localhost/mean-angular5', { promiseLibrary: require('bluebird') }) 19 | .then(() => console.log('connection succesful')).catch((err) => console.error(err)); 20 | 21 | app.use(logger('dev')); 22 | app.use(bodyParser.json()); 23 | app.use(bodyParser.urlencoded({'extended':'false'})); 24 | app.use(express.static(path.join(__dirname, 'dist'))); 25 | 26 | app.use('/books', express.static(path.join(__dirname, 'dist'))); 27 | app.use('/book', book); 28 | 29 | // catch 404 and forward to error handler 30 | app.use(function(req, res, next) { 31 | var err = new Error('Not Found'); 32 | err.status = 404; 33 | next(err); 34 | }); 35 | 36 | // error handler 37 | app.use(function(err, req, res, next) { 38 | // set locals, only providing error in development 39 | res.locals.message = err.message; 40 | res.locals.error = req.app.get('env') === 'development' ? err : {}; 41 | 42 | // render the error page 43 | res.status(err.status || 500); 44 | res.render('error'); 45 | }); 46 | 47 | module.exports = app; 48 | -------------------------------------------------------------------------------- /api/bin/www: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /** 4 | * Module dependencies. 5 | */ 6 | 7 | var app = require('../app'); 8 | var debug = require('debug')('backend:server'); 9 | var http = require('http'); 10 | 11 | /** 12 | * Get port from environment and store in Express. 13 | */ 14 | 15 | var port = normalizePort(process.env.PORT || '3000'); 16 | app.set('port', port); 17 | 18 | /** 19 | * Create HTTP server. 20 | */ 21 | 22 | var server = http.createServer(app); 23 | 24 | /** 25 | * Listen on provided port, on all network interfaces. 26 | */ 27 | 28 | server.listen(port); 29 | server.on('error', onError); 30 | server.on('listening', onListening); 31 | 32 | /** 33 | * Normalize a port into a number, string, or false. 34 | */ 35 | 36 | function normalizePort(val) { 37 | var port = parseInt(val, 10); 38 | 39 | if (isNaN(port)) { 40 | // named pipe 41 | return val; 42 | } 43 | 44 | if (port >= 0) { 45 | // port number 46 | return port; 47 | } 48 | 49 | return false; 50 | } 51 | 52 | /** 53 | * Event listener for HTTP server "error" event. 54 | */ 55 | 56 | function onError(error) { 57 | if (error.syscall !== 'listen') { 58 | throw error; 59 | } 60 | 61 | var bind = typeof port === 'string' 62 | ? 'Pipe ' + port 63 | : 'Port ' + port; 64 | 65 | // handle specific listen errors with friendly messages 66 | switch (error.code) { 67 | case 'EACCES': 68 | console.error(bind + ' requires elevated privileges'); 69 | process.exit(1); 70 | break; 71 | case 'EADDRINUSE': 72 | console.error(bind + ' is already in use'); 73 | process.exit(1); 74 | break; 75 | default: 76 | throw error; 77 | } 78 | } 79 | 80 | /** 81 | * Event listener for HTTP server "listening" event. 82 | */ 83 | 84 | function onListening() { 85 | var addr = server.address(); 86 | var bind = typeof addr === 'string' 87 | ? 'pipe ' + addr 88 | : 'port ' + addr.port; 89 | debug('Listening on ' + bind); 90 | } 91 | -------------------------------------------------------------------------------- /api/models/Book.js: -------------------------------------------------------------------------------- 1 | var mongoose = require('mongoose'); 2 | var BookSchema = new mongoose.Schema({ 3 | isbn: String, 4 | title: String, 5 | author: String, 6 | description: String, 7 | published_year: String, 8 | publisher: String, 9 | updated_date: { type: Date, default: Date.now }, 10 | }); 11 | module.exports = mongoose.model('Book', BookSchema); 12 | -------------------------------------------------------------------------------- /api/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "api", 3 | "version": "1.0.0", 4 | "description": "test", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "node nodemon ./bin/www &" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "express": "^4.16.2", 14 | "bluebird": "^3.5.1", 15 | "body-parser": "^1.18.2", 16 | "core-js": "^2.4.1", 17 | "mongoose": "^5.0.1", 18 | "morgan": "^1.9.0", 19 | "rxjs": "^5.5.2", 20 | "serve-favicon": "^2.4.5", 21 | "cookie-parser": "~1.4.3", 22 | "debug": "~2.6.3", 23 | "jade": "~1.11.0" 24 | }, 25 | "devDependencies": { 26 | "nodemon": "^1.14.12" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /api/routes/book.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var router = express.Router(); 3 | var mongoose = require('mongoose'); 4 | var Book = require('../models/Book.js'); 5 | 6 | /* GET ALL BOOKS */ 7 | router.get('/', function(req, res, next) { 8 | Book.find(function (err, products) { 9 | if (err) return next(err); 10 | res.json(products); 11 | }); 12 | }); 13 | 14 | /* GET SINGLE BOOK BY ID */ 15 | router.get('/:id', function(req, res, next) { 16 | Book.findById(req.params.id, function (err, post) { 17 | if (err) return next(err); 18 | res.json(post); 19 | }); 20 | }); 21 | 22 | /* SAVE BOOK */ 23 | router.post('/', function(req, res, next) { 24 | Book.create(req.body, function (err, post) { 25 | if (err) return next(err); 26 | res.json(post); 27 | }); 28 | }); 29 | 30 | /* UPDATE BOOK */ 31 | router.put('/:id', function(req, res, next) { 32 | console.log('---------------------'); 33 | console.log(req.body); 34 | /*req.body = {'title' : 3};*/ 35 | console.log('---------------------'); 36 | Book.findByIdAndUpdate(req.params.id, req.body, function (err, post) { 37 | if (err) return next(err); 38 | res.json(post); 39 | }); 40 | }); 41 | 42 | /* DELETE BOOK */ 43 | router.delete('/:id', function(req, res, next) { 44 | Book.findByIdAndRemove(req.params.id, req.body, function (err, post) { 45 | if (err) return next(err); 46 | res.json(post); 47 | }); 48 | }); 49 | 50 | module.exports = router; 51 | -------------------------------------------------------------------------------- /api/views/error.jade: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h1= message 5 | h2= error.status 6 | pre #{error.stack} 7 | -------------------------------------------------------------------------------- /api/views/index.jade: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h1= title 5 | p Welcome to #{title} 6 | -------------------------------------------------------------------------------- /api/views/layout.jade: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title= title 5 | link(rel='stylesheet', href='/stylesheets/style.css') 6 | body 7 | block content 8 | -------------------------------------------------------------------------------- /e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('mean-stack App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "jasminewd2", 11 | "node" 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular/cli'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular/cli/plugins/karma') 14 | ], 15 | client:{ 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | reports: [ 'html', 'lcovonly' ], 20 | fixWebpackSourcePaths: true 21 | }, 22 | angularCli: { 23 | environment: 'dev' 24 | }, 25 | reporters: ['progress', 'kjhtml'], 26 | port: 9876, 27 | colors: true, 28 | logLevel: config.LOG_INFO, 29 | autoWatch: true, 30 | browsers: ['Chrome'], 31 | singleRun: false 32 | }); 33 | }; 34 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mean-stack-with-ang5-mongo-express", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "description": "mean-stack-with-ang5-mongo-express", 6 | "scripts": { 7 | "ng": "ng", 8 | "prestart": "node ./api/bin/www &", 9 | "start": "ng serve --proxy-config proxy.conf.json", 10 | "build": "ng build --prod", 11 | "test": "ng test", 12 | "lint": "ng lint", 13 | "e2e": "ng e2e" 14 | }, 15 | "private": true, 16 | "dependencies": { 17 | "@angular-devkit/core": "0.0.28", 18 | "@angular/animations": "^5.0.0", 19 | "@angular/common": "^5.0.0", 20 | "@angular/compiler": "^5.0.0", 21 | "@angular/core": "^5.0.0", 22 | "@angular/forms": "^5.0.0", 23 | "@angular/http": "^5.0.0", 24 | "@angular/platform-browser": "^5.0.0", 25 | "@angular/platform-browser-dynamic": "^5.0.0", 26 | "@angular/router": "^5.0.0", 27 | "bluebird": "^3.5.1", 28 | "body-parser": "^1.18.2", 29 | "core-js": "^2.4.1", 30 | "express": "^4.16.2", 31 | "mongoose": "^5.0.1", 32 | "morgan": "^1.9.0", 33 | "rxjs": "^5.5.2", 34 | "serve-favicon": "^2.4.5", 35 | "zone.js": "^0.8.14" 36 | }, 37 | "devDependencies": { 38 | "@angular/cli": "1.6.1", 39 | "@angular/compiler-cli": "^5.0.0", 40 | "@angular/language-service": "^5.0.0", 41 | "@types/jasmine": "~2.5.53", 42 | "@types/jasminewd2": "~2.0.2", 43 | "@types/node": "~6.0.60", 44 | "codelyzer": "^4.0.1", 45 | "jasmine-core": "~2.6.2", 46 | "jasmine-spec-reporter": "~4.1.0", 47 | "karma": "~1.7.0", 48 | "karma-chrome-launcher": "~2.1.1", 49 | "karma-cli": "~1.0.1", 50 | "karma-coverage-istanbul-reporter": "^1.2.1", 51 | "karma-jasmine": "~1.1.0", 52 | "karma-jasmine-html-reporter": "^0.2.2", 53 | "nodemon": "^1.14.12", 54 | "protractor": "~5.1.2", 55 | "ts-node": "~3.2.0", 56 | "tslint": "~5.7.0", 57 | "typescript": "~2.4.2" 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './e2e/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: 'e2e/tsconfig.e2e.json' 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "/api": { 3 | "target": "http://localhost:3000", 4 | "secure": false, 5 | "pathRewrite": { 6 | "^/api": "" 7 | }, 8 | "logLevel": "debug" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anvesh1/mean-starter-with-angular5/32b8720cb4b9e1ddec9791409ced57cb80f877e7/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | MeanAngular5 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /public/inline.bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // install a JSONP callback for chunk loading 3 | /******/ var parentJsonpFunction = window["webpackJsonp"]; 4 | /******/ window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) { 5 | /******/ // add "moreModules" to the modules object, 6 | /******/ // then flag all "chunkIds" as loaded and fire callback 7 | /******/ var moduleId, chunkId, i = 0, resolves = [], result; 8 | /******/ for(;i < chunkIds.length; i++) { 9 | /******/ chunkId = chunkIds[i]; 10 | /******/ if(installedChunks[chunkId]) { 11 | /******/ resolves.push(installedChunks[chunkId][0]); 12 | /******/ } 13 | /******/ installedChunks[chunkId] = 0; 14 | /******/ } 15 | /******/ for(moduleId in moreModules) { 16 | /******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { 17 | /******/ modules[moduleId] = moreModules[moduleId]; 18 | /******/ } 19 | /******/ } 20 | /******/ if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules); 21 | /******/ while(resolves.length) { 22 | /******/ resolves.shift()(); 23 | /******/ } 24 | /******/ if(executeModules) { 25 | /******/ for(i=0; i < executeModules.length; i++) { 26 | /******/ result = __webpack_require__(__webpack_require__.s = executeModules[i]); 27 | /******/ } 28 | /******/ } 29 | /******/ return result; 30 | /******/ }; 31 | /******/ 32 | /******/ // The module cache 33 | /******/ var installedModules = {}; 34 | /******/ 35 | /******/ // objects to store loaded and loading chunks 36 | /******/ var installedChunks = { 37 | /******/ "inline": 0 38 | /******/ }; 39 | /******/ 40 | /******/ // The require function 41 | /******/ function __webpack_require__(moduleId) { 42 | /******/ 43 | /******/ // Check if module is in cache 44 | /******/ if(installedModules[moduleId]) { 45 | /******/ return installedModules[moduleId].exports; 46 | /******/ } 47 | /******/ // Create a new module (and put it into the cache) 48 | /******/ var module = installedModules[moduleId] = { 49 | /******/ i: moduleId, 50 | /******/ l: false, 51 | /******/ exports: {} 52 | /******/ }; 53 | /******/ 54 | /******/ // Execute the module function 55 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 56 | /******/ 57 | /******/ // Flag the module as loaded 58 | /******/ module.l = true; 59 | /******/ 60 | /******/ // Return the exports of the module 61 | /******/ return module.exports; 62 | /******/ } 63 | /******/ 64 | /******/ // This file contains only the entry chunk. 65 | /******/ // The chunk loading function for additional chunks 66 | /******/ __webpack_require__.e = function requireEnsure(chunkId) { 67 | /******/ var installedChunkData = installedChunks[chunkId]; 68 | /******/ if(installedChunkData === 0) { 69 | /******/ return new Promise(function(resolve) { resolve(); }); 70 | /******/ } 71 | /******/ 72 | /******/ // a Promise means "currently loading". 73 | /******/ if(installedChunkData) { 74 | /******/ return installedChunkData[2]; 75 | /******/ } 76 | /******/ 77 | /******/ // setup Promise in chunk cache 78 | /******/ var promise = new Promise(function(resolve, reject) { 79 | /******/ installedChunkData = installedChunks[chunkId] = [resolve, reject]; 80 | /******/ }); 81 | /******/ installedChunkData[2] = promise; 82 | /******/ 83 | /******/ // start chunk loading 84 | /******/ var head = document.getElementsByTagName('head')[0]; 85 | /******/ var script = document.createElement('script'); 86 | /******/ script.type = 'text/javascript'; 87 | /******/ script.charset = 'utf-8'; 88 | /******/ script.async = true; 89 | /******/ script.timeout = 120000; 90 | /******/ 91 | /******/ if (__webpack_require__.nc) { 92 | /******/ script.setAttribute("nonce", __webpack_require__.nc); 93 | /******/ } 94 | /******/ script.src = __webpack_require__.p + "" + chunkId + ".chunk.js"; 95 | /******/ var timeout = setTimeout(onScriptComplete, 120000); 96 | /******/ script.onerror = script.onload = onScriptComplete; 97 | /******/ function onScriptComplete() { 98 | /******/ // avoid mem leaks in IE. 99 | /******/ script.onerror = script.onload = null; 100 | /******/ clearTimeout(timeout); 101 | /******/ var chunk = installedChunks[chunkId]; 102 | /******/ if(chunk !== 0) { 103 | /******/ if(chunk) { 104 | /******/ chunk[1](new Error('Loading chunk ' + chunkId + ' failed.')); 105 | /******/ } 106 | /******/ installedChunks[chunkId] = undefined; 107 | /******/ } 108 | /******/ }; 109 | /******/ head.appendChild(script); 110 | /******/ 111 | /******/ return promise; 112 | /******/ }; 113 | /******/ 114 | /******/ // expose the modules object (__webpack_modules__) 115 | /******/ __webpack_require__.m = modules; 116 | /******/ 117 | /******/ // expose the module cache 118 | /******/ __webpack_require__.c = installedModules; 119 | /******/ 120 | /******/ // define getter function for harmony exports 121 | /******/ __webpack_require__.d = function(exports, name, getter) { 122 | /******/ if(!__webpack_require__.o(exports, name)) { 123 | /******/ Object.defineProperty(exports, name, { 124 | /******/ configurable: false, 125 | /******/ enumerable: true, 126 | /******/ get: getter 127 | /******/ }); 128 | /******/ } 129 | /******/ }; 130 | /******/ 131 | /******/ // getDefaultExport function for compatibility with non-harmony modules 132 | /******/ __webpack_require__.n = function(module) { 133 | /******/ var getter = module && module.__esModule ? 134 | /******/ function getDefault() { return module['default']; } : 135 | /******/ function getModuleExports() { return module; }; 136 | /******/ __webpack_require__.d(getter, 'a', getter); 137 | /******/ return getter; 138 | /******/ }; 139 | /******/ 140 | /******/ // Object.prototype.hasOwnProperty.call 141 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 142 | /******/ 143 | /******/ // __webpack_public_path__ 144 | /******/ __webpack_require__.p = ""; 145 | /******/ 146 | /******/ // on error function for async loading 147 | /******/ __webpack_require__.oe = function(err) { console.error(err); throw err; }; 148 | /******/ }) 149 | /************************************************************************/ 150 | /******/ ([]); 151 | //# sourceMappingURL=inline.bundle.js.map -------------------------------------------------------------------------------- /public/inline.bundle.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack/bootstrap 9fe0b614639b183b00b6"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kDAA0C,WAAW,EAAE;AACvD;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA,kDAA0C,oBAAoB,WAAW","file":"inline.bundle.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t\"inline\": 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar installedChunkData = installedChunks[chunkId];\n \t\tif(installedChunkData === 0) {\n \t\t\treturn new Promise(function(resolve) { resolve(); });\n \t\t}\n\n \t\t// a Promise means \"currently loading\".\n \t\tif(installedChunkData) {\n \t\t\treturn installedChunkData[2];\n \t\t}\n\n \t\t// setup Promise in chunk cache\n \t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t});\n \t\tinstalledChunkData[2] = promise;\n\n \t\t// start chunk loading\n \t\tvar head = document.getElementsByTagName('head')[0];\n \t\tvar script = document.createElement('script');\n \t\tscript.type = 'text/javascript';\n \t\tscript.charset = 'utf-8';\n \t\tscript.async = true;\n \t\tscript.timeout = 120000;\n\n \t\tif (__webpack_require__.nc) {\n \t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t}\n \t\tscript.src = __webpack_require__.p + \"\" + chunkId + \".chunk.js\";\n \t\tvar timeout = setTimeout(onScriptComplete, 120000);\n \t\tscript.onerror = script.onload = onScriptComplete;\n \t\tfunction onScriptComplete() {\n \t\t\t// avoid mem leaks in IE.\n \t\t\tscript.onerror = script.onload = null;\n \t\t\tclearTimeout(timeout);\n \t\t\tvar chunk = installedChunks[chunkId];\n \t\t\tif(chunk !== 0) {\n \t\t\t\tif(chunk) {\n \t\t\t\t\tchunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));\n \t\t\t\t}\n \t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t}\n \t\t};\n \t\thead.appendChild(script);\n\n \t\treturn promise;\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 9fe0b614639b183b00b6"],"sourceRoot":"webpack:///"} -------------------------------------------------------------------------------- /public/main.bundle.js: -------------------------------------------------------------------------------- 1 | webpackJsonp(["main"],{ 2 | 3 | /***/ "../../../../../src/$$_lazy_route_resource lazy recursive": 4 | /***/ (function(module, exports) { 5 | 6 | function webpackEmptyAsyncContext(req) { 7 | // Here Promise.resolve().then() is used instead of new Promise() to prevent 8 | // uncatched exception popping up in devtools 9 | return Promise.resolve().then(function() { 10 | throw new Error("Cannot find module '" + req + "'."); 11 | }); 12 | } 13 | webpackEmptyAsyncContext.keys = function() { return []; }; 14 | webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext; 15 | module.exports = webpackEmptyAsyncContext; 16 | webpackEmptyAsyncContext.id = "../../../../../src/$$_lazy_route_resource lazy recursive"; 17 | 18 | /***/ }), 19 | 20 | /***/ "../../../../../src/app/app.component.css": 21 | /***/ (function(module, exports, __webpack_require__) { 22 | 23 | exports = module.exports = __webpack_require__("../../../../css-loader/lib/css-base.js")(false); 24 | // imports 25 | 26 | 27 | // module 28 | exports.push([module.i, "", ""]); 29 | 30 | // exports 31 | 32 | 33 | /*** EXPORTS FROM exports-loader ***/ 34 | module.exports = module.exports.toString(); 35 | 36 | /***/ }), 37 | 38 | /***/ "../../../../../src/app/app.component.html": 39 | /***/ (function(module, exports) { 40 | 41 | module.exports = "\n" 42 | 43 | /***/ }), 44 | 45 | /***/ "../../../../../src/app/app.component.ts": 46 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 47 | 48 | "use strict"; 49 | /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AppComponent; }); 50 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__("../../../core/esm5/core.js"); 51 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 52 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 53 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 54 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 55 | return c > 3 && r && Object.defineProperty(target, key, r), r; 56 | }; 57 | 58 | var AppComponent = (function () { 59 | function AppComponent() { 60 | this.title = 'app'; 61 | } 62 | AppComponent = __decorate([ 63 | Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Component */])({ 64 | selector: 'app-root', 65 | template: __webpack_require__("../../../../../src/app/app.component.html"), 66 | styles: [__webpack_require__("../../../../../src/app/app.component.css")] 67 | }) 68 | ], AppComponent); 69 | return AppComponent; 70 | }()); 71 | 72 | 73 | 74 | /***/ }), 75 | 76 | /***/ "../../../../../src/app/app.module.ts": 77 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 78 | 79 | "use strict"; 80 | /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AppModule; }); 81 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_platform_browser__ = __webpack_require__("../../../platform-browser/esm5/platform-browser.js"); 82 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__("../../../core/esm5/core.js"); 83 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__app_component__ = __webpack_require__("../../../../../src/app/app.component.ts"); 84 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__book_book_component__ = __webpack_require__("../../../../../src/app/book/book.component.ts"); 85 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__angular_forms__ = __webpack_require__("../../../forms/esm5/forms.js"); 86 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__angular_common_http__ = __webpack_require__("../../../common/esm5/http.js"); 87 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__angular_router__ = __webpack_require__("../../../router/esm5/router.js"); 88 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__book_detail_book_detail_component__ = __webpack_require__("../../../../../src/app/book-detail/book-detail.component.ts"); 89 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__book_create_book_create_component__ = __webpack_require__("../../../../../src/app/book-create/book-create.component.ts"); 90 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__book_edit_book_edit_component__ = __webpack_require__("../../../../../src/app/book-edit/book-edit.component.ts"); 91 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 92 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 93 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 94 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 95 | return c > 3 && r && Object.defineProperty(target, key, r), r; 96 | }; 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | var appRoutes = [ 108 | { 109 | path: 'books', 110 | component: __WEBPACK_IMPORTED_MODULE_3__book_book_component__["a" /* BookComponent */], 111 | data: { title: 'Book List' } 112 | }, 113 | { 114 | path: 'book-details/:id', 115 | component: __WEBPACK_IMPORTED_MODULE_7__book_detail_book_detail_component__["a" /* BookDetailComponent */], 116 | data: { title: 'Book Details' } 117 | }, 118 | { 119 | path: 'book-create', 120 | component: __WEBPACK_IMPORTED_MODULE_8__book_create_book_create_component__["a" /* BookCreateComponent */], 121 | data: { title: 'Create Book' } 122 | }, 123 | { 124 | path: 'book-edit/:id', 125 | component: __WEBPACK_IMPORTED_MODULE_9__book_edit_book_edit_component__["a" /* BookEditComponent */], 126 | data: { title: 'Edit Book' } 127 | }, 128 | { path: '', 129 | redirectTo: '/books', 130 | pathMatch: 'full' 131 | } 132 | ]; 133 | var AppModule = (function () { 134 | function AppModule() { 135 | } 136 | AppModule = __decorate([ 137 | Object(__WEBPACK_IMPORTED_MODULE_1__angular_core__["I" /* NgModule */])({ 138 | declarations: [ 139 | __WEBPACK_IMPORTED_MODULE_2__app_component__["a" /* AppComponent */], 140 | __WEBPACK_IMPORTED_MODULE_3__book_book_component__["a" /* BookComponent */], 141 | __WEBPACK_IMPORTED_MODULE_7__book_detail_book_detail_component__["a" /* BookDetailComponent */], 142 | __WEBPACK_IMPORTED_MODULE_8__book_create_book_create_component__["a" /* BookCreateComponent */], 143 | __WEBPACK_IMPORTED_MODULE_9__book_edit_book_edit_component__["a" /* BookEditComponent */] 144 | ], 145 | imports: [ 146 | __WEBPACK_IMPORTED_MODULE_0__angular_platform_browser__["a" /* BrowserModule */], 147 | __WEBPACK_IMPORTED_MODULE_4__angular_forms__["a" /* FormsModule */], 148 | __WEBPACK_IMPORTED_MODULE_5__angular_common_http__["b" /* HttpClientModule */], 149 | __WEBPACK_IMPORTED_MODULE_6__angular_router__["c" /* RouterModule */].forRoot(appRoutes, { enableTracing: true } // <-- debugging purposes only 150 | ) 151 | ], 152 | providers: [], 153 | bootstrap: [__WEBPACK_IMPORTED_MODULE_2__app_component__["a" /* AppComponent */]] 154 | }) 155 | ], AppModule); 156 | return AppModule; 157 | }()); 158 | 159 | 160 | 161 | /***/ }), 162 | 163 | /***/ "../../../../../src/app/book-create/book-create.component.css": 164 | /***/ (function(module, exports, __webpack_require__) { 165 | 166 | exports = module.exports = __webpack_require__("../../../../css-loader/lib/css-base.js")(false); 167 | // imports 168 | 169 | 170 | // module 171 | exports.push([module.i, "", ""]); 172 | 173 | // exports 174 | 175 | 176 | /*** EXPORTS FROM exports-loader ***/ 177 | module.exports = module.exports.toString(); 178 | 179 | /***/ }), 180 | 181 | /***/ "../../../../../src/app/book-create/book-create.component.html": 182 | /***/ (function(module, exports) { 183 | 184 | module.exports = "
\n

Add New Book

\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n
\n
\n
\n
\n
\n" 185 | 186 | /***/ }), 187 | 188 | /***/ "../../../../../src/app/book-create/book-create.component.ts": 189 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 190 | 191 | "use strict"; 192 | /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BookCreateComponent; }); 193 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__("../../../core/esm5/core.js"); 194 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_router__ = __webpack_require__("../../../router/esm5/router.js"); 195 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_common_http__ = __webpack_require__("../../../common/esm5/http.js"); 196 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 197 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 198 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 199 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 200 | return c > 3 && r && Object.defineProperty(target, key, r), r; 201 | }; 202 | var __metadata = (this && this.__metadata) || function (k, v) { 203 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 204 | }; 205 | 206 | 207 | 208 | var BookCreateComponent = (function () { 209 | function BookCreateComponent(http, router) { 210 | this.http = http; 211 | this.router = router; 212 | this.book = {}; 213 | } 214 | BookCreateComponent.prototype.ngOnInit = function () { 215 | }; 216 | BookCreateComponent.prototype.saveBook = function () { 217 | var _this = this; 218 | this.http.post('/book', this.book) 219 | .subscribe(function (res) { 220 | var id = res['_id']; 221 | _this.router.navigate(['/book-details', id]); 222 | }, function (err) { 223 | console.log(err); 224 | }); 225 | }; 226 | BookCreateComponent = __decorate([ 227 | Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Component */])({ 228 | selector: 'app-book-create', 229 | template: __webpack_require__("../../../../../src/app/book-create/book-create.component.html"), 230 | styles: [__webpack_require__("../../../../../src/app/book-create/book-create.component.css")], 231 | encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_10" /* ViewEncapsulation */].None 232 | }), 233 | __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_2__angular_common_http__["a" /* HttpClient */], __WEBPACK_IMPORTED_MODULE_1__angular_router__["b" /* Router */]]) 234 | ], BookCreateComponent); 235 | return BookCreateComponent; 236 | }()); 237 | 238 | 239 | 240 | /***/ }), 241 | 242 | /***/ "../../../../../src/app/book-detail/book-detail.component.css": 243 | /***/ (function(module, exports, __webpack_require__) { 244 | 245 | exports = module.exports = __webpack_require__("../../../../css-loader/lib/css-base.js")(false); 246 | // imports 247 | 248 | 249 | // module 250 | exports.push([module.i, "", ""]); 251 | 252 | // exports 253 | 254 | 255 | /*** EXPORTS FROM exports-loader ***/ 256 | module.exports = module.exports.toString(); 257 | 258 | /***/ }), 259 | 260 | /***/ "../../../../../src/app/book-detail/book-detail.component.html": 261 | /***/ (function(module, exports) { 262 | 263 | module.exports = "
\n

{{ book.title }}

\n
\n
ISBN
\n
{{ book.isbn }}
\n
Author
\n
{{ book.author }}
\n
Publisher
\n
{{ book.publisher }}
\n
Price
\n
{{ book.price }}
\n
Update Date
\n
{{ book.updated_at }}
\n
\n
\n Edit\n \n Back\n
\n
\n" 264 | 265 | /***/ }), 266 | 267 | /***/ "../../../../../src/app/book-detail/book-detail.component.ts": 268 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 269 | 270 | "use strict"; 271 | /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BookDetailComponent; }); 272 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__("../../../core/esm5/core.js"); 273 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common_http__ = __webpack_require__("../../../common/esm5/http.js"); 274 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_router__ = __webpack_require__("../../../router/esm5/router.js"); 275 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 276 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 277 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 278 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 279 | return c > 3 && r && Object.defineProperty(target, key, r), r; 280 | }; 281 | var __metadata = (this && this.__metadata) || function (k, v) { 282 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 283 | }; 284 | 285 | 286 | 287 | var BookDetailComponent = (function () { 288 | function BookDetailComponent(router, route, http) { 289 | this.router = router; 290 | this.route = route; 291 | this.http = http; 292 | this.book = {}; 293 | } 294 | BookDetailComponent.prototype.ngOnInit = function () { 295 | this.getBookDetail(this.route.snapshot.params['id']); 296 | }; 297 | BookDetailComponent.prototype.getBookDetail = function (id) { 298 | var _this = this; 299 | this.http.get('/book/' + id).subscribe(function (data) { 300 | _this.book = data; 301 | }); 302 | }; 303 | BookDetailComponent.prototype.deleteBook = function (id) { 304 | var _this = this; 305 | this.http.delete('/book/' + id) 306 | .subscribe(function (res) { 307 | _this.router.navigate(['/books']); 308 | }, function (err) { 309 | console.log(err); 310 | }); 311 | }; 312 | BookDetailComponent = __decorate([ 313 | Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Component */])({ 314 | selector: 'app-book-detail', 315 | template: __webpack_require__("../../../../../src/app/book-detail/book-detail.component.html"), 316 | styles: [__webpack_require__("../../../../../src/app/book-detail/book-detail.component.css")], 317 | encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_10" /* ViewEncapsulation */].None 318 | }), 319 | __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_2__angular_router__["b" /* Router */], __WEBPACK_IMPORTED_MODULE_2__angular_router__["a" /* ActivatedRoute */], __WEBPACK_IMPORTED_MODULE_1__angular_common_http__["a" /* HttpClient */]]) 320 | ], BookDetailComponent); 321 | return BookDetailComponent; 322 | }()); 323 | 324 | 325 | 326 | /***/ }), 327 | 328 | /***/ "../../../../../src/app/book-edit/book-edit.component.css": 329 | /***/ (function(module, exports, __webpack_require__) { 330 | 331 | exports = module.exports = __webpack_require__("../../../../css-loader/lib/css-base.js")(false); 332 | // imports 333 | 334 | 335 | // module 336 | exports.push([module.i, "", ""]); 337 | 338 | // exports 339 | 340 | 341 | /*** EXPORTS FROM exports-loader ***/ 342 | module.exports = module.exports.toString(); 343 | 344 | /***/ }), 345 | 346 | /***/ "../../../../../src/app/book-edit/book-edit.component.html": 347 | /***/ (function(module, exports) { 348 | 349 | module.exports = "
\n

Edit Book

\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n
\n
\n
\n
\n
\n" 350 | 351 | /***/ }), 352 | 353 | /***/ "../../../../../src/app/book-edit/book-edit.component.ts": 354 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 355 | 356 | "use strict"; 357 | /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BookEditComponent; }); 358 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__("../../../core/esm5/core.js"); 359 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_router__ = __webpack_require__("../../../router/esm5/router.js"); 360 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_common_http__ = __webpack_require__("../../../common/esm5/http.js"); 361 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 362 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 363 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 364 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 365 | return c > 3 && r && Object.defineProperty(target, key, r), r; 366 | }; 367 | var __metadata = (this && this.__metadata) || function (k, v) { 368 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 369 | }; 370 | 371 | 372 | 373 | var BookEditComponent = (function () { 374 | function BookEditComponent(http, router, route) { 375 | this.http = http; 376 | this.router = router; 377 | this.route = route; 378 | this.book = {}; 379 | } 380 | BookEditComponent.prototype.ngOnInit = function () { 381 | this.getBook(this.route.snapshot.params['id']); 382 | }; 383 | BookEditComponent.prototype.getBook = function (id) { 384 | var _this = this; 385 | this.http.get('/book/' + id).subscribe(function (data) { 386 | _this.book = data; 387 | }); 388 | }; 389 | BookEditComponent.prototype.updateBook = function (id) { 390 | var _this = this; 391 | this.http.put('/book/' + id, this.book) 392 | .subscribe(function (res) { 393 | var id = res['_id']; 394 | _this.router.navigate(['/book-details', id]); 395 | }, function (err) { 396 | console.log(err); 397 | }); 398 | }; 399 | BookEditComponent = __decorate([ 400 | Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Component */])({ 401 | selector: 'app-book-edit', 402 | template: __webpack_require__("../../../../../src/app/book-edit/book-edit.component.html"), 403 | styles: [__webpack_require__("../../../../../src/app/book-edit/book-edit.component.css")], 404 | encapsulation: __WEBPACK_IMPORTED_MODULE_0__angular_core__["_10" /* ViewEncapsulation */].None 405 | }), 406 | __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_2__angular_common_http__["a" /* HttpClient */], __WEBPACK_IMPORTED_MODULE_1__angular_router__["b" /* Router */], __WEBPACK_IMPORTED_MODULE_1__angular_router__["a" /* ActivatedRoute */]]) 407 | ], BookEditComponent); 408 | return BookEditComponent; 409 | }()); 410 | 411 | 412 | 413 | /***/ }), 414 | 415 | /***/ "../../../../../src/app/book/book.component.css": 416 | /***/ (function(module, exports, __webpack_require__) { 417 | 418 | exports = module.exports = __webpack_require__("../../../../css-loader/lib/css-base.js")(false); 419 | // imports 420 | 421 | 422 | // module 423 | exports.push([module.i, "", ""]); 424 | 425 | // exports 426 | 427 | 428 | /*** EXPORTS FROM exports-loader ***/ 429 | module.exports = module.exports.toString(); 430 | 431 | /***/ }), 432 | 433 | /***/ "../../../../../src/app/book/book.component.html": 434 | /***/ (function(module, exports) { 435 | 436 | module.exports = "
\n

\n Book List\n \n \n \n

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Title 1AuthorAction
{{ book.title }}{{ book.author }}\n Show Detail\n \n
\n
\n" 437 | 438 | /***/ }), 439 | 440 | /***/ "../../../../../src/app/book/book.component.ts": 441 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 442 | 443 | "use strict"; 444 | /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BookComponent; }); 445 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__("../../../core/esm5/core.js"); 446 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_common_http__ = __webpack_require__("../../../common/esm5/http.js"); 447 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_router__ = __webpack_require__("../../../router/esm5/router.js"); 448 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { 449 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 450 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 451 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 452 | return c > 3 && r && Object.defineProperty(target, key, r), r; 453 | }; 454 | var __metadata = (this && this.__metadata) || function (k, v) { 455 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); 456 | }; 457 | 458 | 459 | 460 | var BookComponent = (function () { 461 | function BookComponent(router, route, http) { 462 | this.router = router; 463 | this.route = route; 464 | this.http = http; 465 | } 466 | BookComponent.prototype.ngOnInit = function () { 467 | var _this = this; 468 | this.http.get('/api/book').subscribe(function (data) { 469 | _this.books = data; 470 | }); 471 | }; 472 | BookComponent.prototype.deleteBook = function (id) { 473 | var _this = this; 474 | this.http.delete('/book/' + id) 475 | .subscribe(function (res) { 476 | _this.http.get('/book').subscribe(function (data) { 477 | _this.books = data; 478 | }); 479 | }, function (err) { 480 | console.log(err); 481 | }); 482 | }; 483 | BookComponent = __decorate([ 484 | Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["n" /* Component */])({ 485 | selector: 'app-book', 486 | template: __webpack_require__("../../../../../src/app/book/book.component.html"), 487 | styles: [__webpack_require__("../../../../../src/app/book/book.component.css")] 488 | }), 489 | __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_2__angular_router__["b" /* Router */], __WEBPACK_IMPORTED_MODULE_2__angular_router__["a" /* ActivatedRoute */], __WEBPACK_IMPORTED_MODULE_1__angular_common_http__["a" /* HttpClient */]]) 490 | ], BookComponent); 491 | return BookComponent; 492 | }()); 493 | 494 | 495 | 496 | /***/ }), 497 | 498 | /***/ "../../../../../src/environments/environment.ts": 499 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 500 | 501 | "use strict"; 502 | /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return environment; }); 503 | // The file contents for the current environment will overwrite these during build. 504 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 505 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 506 | // The list of which env maps to which file can be found in `.angular-cli.json`. 507 | var environment = { 508 | production: false 509 | }; 510 | 511 | 512 | /***/ }), 513 | 514 | /***/ "../../../../../src/main.ts": 515 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 516 | 517 | "use strict"; 518 | Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 519 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__("../../../core/esm5/core.js"); 520 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_platform_browser_dynamic__ = __webpack_require__("../../../platform-browser-dynamic/esm5/platform-browser-dynamic.js"); 521 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__app_app_module__ = __webpack_require__("../../../../../src/app/app.module.ts"); 522 | /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__environments_environment__ = __webpack_require__("../../../../../src/environments/environment.ts"); 523 | 524 | 525 | 526 | 527 | if (__WEBPACK_IMPORTED_MODULE_3__environments_environment__["a" /* environment */].production) { 528 | Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["_13" /* enableProdMode */])(); 529 | } 530 | Object(__WEBPACK_IMPORTED_MODULE_1__angular_platform_browser_dynamic__["a" /* platformBrowserDynamic */])().bootstrapModule(__WEBPACK_IMPORTED_MODULE_2__app_app_module__["a" /* AppModule */]) 531 | .catch(function (err) { return console.log(err); }); 532 | 533 | 534 | /***/ }), 535 | 536 | /***/ 0: 537 | /***/ (function(module, exports, __webpack_require__) { 538 | 539 | module.exports = __webpack_require__("../../../../../src/main.ts"); 540 | 541 | 542 | /***/ }) 543 | 544 | },[0]); 545 | //# sourceMappingURL=main.bundle.js.map -------------------------------------------------------------------------------- /public/main.bundle.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["/cube/angular-5/mean-stack/src/$_lazy_route_resource lazy","/cube/angular-5/mean-stack/src/app/app.component.css","/cube/angular-5/mean-stack/src/app/app.component.html","/cube/angular-5/mean-stack/src/app/app.component.ts","/cube/angular-5/mean-stack/src/app/app.module.ts","/cube/angular-5/mean-stack/src/app/book-create/book-create.component.css","/cube/angular-5/mean-stack/src/app/book-create/book-create.component.html","/cube/angular-5/mean-stack/src/app/book-create/book-create.component.ts","/cube/angular-5/mean-stack/src/app/book-detail/book-detail.component.css","/cube/angular-5/mean-stack/src/app/book-detail/book-detail.component.html","/cube/angular-5/mean-stack/src/app/book-detail/book-detail.component.ts","/cube/angular-5/mean-stack/src/app/book-edit/book-edit.component.css","/cube/angular-5/mean-stack/src/app/book-edit/book-edit.component.html","/cube/angular-5/mean-stack/src/app/book-edit/book-edit.component.ts","/cube/angular-5/mean-stack/src/app/book/book.component.css","/cube/angular-5/mean-stack/src/app/book/book.component.html","/cube/angular-5/mean-stack/src/app/book/book.component.ts","/cube/angular-5/mean-stack/src/environments/environment.ts","/cube/angular-5/mean-stack/src/main.ts"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,4CAA4C,WAAW;AACvD;AACA;AACA,yF;;;;;;;ACVA;AACA;;;AAGA;AACA;;AAEA;;;AAGA;AACA,2C;;;;;;;ACXA,oD;;;;;;;;;;;;;;;;ACA0C;AAO1C;IALA;QAME,UAAK,GAAG,KAAK,CAAC;IAChB,CAAC;IAFY,YAAY;QALxB,wEAAS,CAAC;YACT,QAAQ,EAAE,UAAU;;;SAGrB,CAAC;OACW,YAAY,CAExB;IAAD,mBAAC;CAAA;AAFwB;;;;;;;;;;;;;;;;;;;;;;;;;;ACPiC;AACjB;AAGM;AACO;AAET;AACW;AAED;AACmB;AACA;AACN;AAEpE,IAAM,SAAS,GAAW;IACxB;QACE,IAAI,EAAE,OAAO;QACb,SAAS,EAAE,2EAAa;QACxB,IAAI,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE;KAC7B;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,SAAS,EAAE,+FAAmB;QAC9B,IAAI,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE;KAChC;IACD;QACE,IAAI,EAAE,aAAa;QACnB,SAAS,EAAE,+FAAmB;QAC9B,IAAI,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE;KAC/B;IACD;QACE,IAAI,EAAE,eAAe;QACrB,SAAS,EAAE,yFAAiB;QAC5B,IAAI,EAAE,EAAE,KAAK,EAAE,WAA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B,CAAC;yCAI4B,+DAAM,EAAiB,uEAAc,EAAgB,wEAAU;OAHhF,aAAa,CAuBzB;IAAD,oBAAC;CAAA;AAvByB;;;;;;;;;ACT1B;AAAA,mFAAmF;AACnF,8FAA8F;AAC9F,yEAAyE;AACzE,gFAAgF;AAEzE,IAAM,WAAW,GAAG;IACzB,UAAU,EAAE,KAAK;CAClB,CAAC;;;;;;;;;;;;;;ACP6C;AAC4B;AAE9B;AACY;AAEzD,EAAE,CAAC,CAAC,8EAAW,CAAC,UAAU,CAAC,CAAC,CAAC;IAC3B,+EAAc,EAAE,CAAC;AACnB,CAAC;AAED,yGAAsB,EAAE,CAAC,eAAe,CAAC,kEAAS,CAAC;KAChD,KAAK,CAAC,aAAG,IAAI,cAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAhB,CAAgB,CAAC,CAAC","file":"main.bundle.js","sourcesContent":["function webpackEmptyAsyncContext(req) {\n\t// Here Promise.resolve().then() is used instead of new Promise() to prevent\n\t// uncatched exception popping up in devtools\n\treturn Promise.resolve().then(function() {\n\t\tthrow new Error(\"Cannot find module '\" + req + \"'.\");\n\t});\n}\nwebpackEmptyAsyncContext.keys = function() { return []; };\nwebpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;\nmodule.exports = webpackEmptyAsyncContext;\nwebpackEmptyAsyncContext.id = \"../../../../../src/$$_lazy_route_resource lazy recursive\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// /cube/angular-5/mean-stack/src/$$_lazy_route_resource lazy\n// module id = ../../../../../src/$$_lazy_route_resource lazy recursive\n// module chunks = main","exports = module.exports = require(\"../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"\", \"\"]);\n\n// exports\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = module.exports.toString();\n\n\n//////////////////\n// WEBPACK FOOTER\n// /cube/angular-5/mean-stack/src/app/app.component.css\n// module id = ../../../../../src/app/app.component.css\n// module chunks = main","module.exports = \"\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// /cube/angular-5/mean-stack/src/app/app.component.html\n// module id = ../../../../../src/app/app.component.html\n// module chunks = main","import { Component } from '@angular/core';\n\n@Component({\n selector: 'app-root',\n templateUrl: './app.component.html',\n styleUrls: ['./app.component.css']\n})\nexport class AppComponent {\n title = 'app';\n}\n\n\n\n// WEBPACK FOOTER //\n// /cube/angular-5/mean-stack/src/app/app.component.ts","import { BrowserModule } from '@angular/platform-browser';\nimport { NgModule } from '@angular/core';\n\n\nimport { AppComponent } from './app.component';\nimport { BookComponent } from './book/book.component';\n\nimport { FormsModule } from '@angular/forms';\nimport { HttpClientModule } from '@angular/common/http';\n\nimport { RouterModule, Routes } from '@angular/router';\nimport { BookDetailComponent } from './book-detail/book-detail.component';\nimport { BookCreateComponent } from './book-create/book-create.component';\nimport { BookEditComponent } from './book-edit/book-edit.component';\n\nconst appRoutes: Routes = [\n {\n path: 'books',\n component: BookComponent,\n data: { title: 'Book List' }\n },\n {\n path: 'book-details/:id',\n component: BookDetailComponent,\n data: { title: 'Book Details' }\n },\n {\n path: 'book-create',\n component: BookCreateComponent,\n data: { title: 'Create Book' }\n },\n {\n path: 'book-edit/:id',\n component: BookEditComponent,\n data: { title: 'Edit Book' }\n },\n { path: '',\n redirectTo: '/books',\n pathMatch: 'full'\n }\n];\n\n\n@NgModule({\n declarations: [\n AppComponent,\n BookComponent,\n BookDetailComponent,\n BookCreateComponent,\n BookEditComponent\n ],\n imports: [\n BrowserModule,\n FormsModule,\n HttpClientModule,\n RouterModule.forRoot(\n appRoutes,\n { enableTracing: true } // <-- debugging purposes only\n )\n ],\n providers: [],\n bootstrap: [AppComponent]\n})\nexport class AppModule { }\n\n\n\n// WEBPACK FOOTER //\n// /cube/angular-5/mean-stack/src/app/app.module.ts","exports = module.exports = require(\"../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"\", \"\"]);\n\n// exports\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = module.exports.toString();\n\n\n//////////////////\n// WEBPACK FOOTER\n// /cube/angular-5/mean-stack/src/app/book-create/book-create.component.css\n// module id = ../../../../../src/app/book-create/book-create.component.css\n// module chunks = main","module.exports = \"
\\n

Add New Book

\\n
\\n
\\n
\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n
\\n \\n
\\n
\\n
\\n
\\n
\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// /cube/angular-5/mean-stack/src/app/book-create/book-create.component.html\n// module id = ../../../../../src/app/book-create/book-create.component.html\n// module chunks = main","import { Component, OnInit, ViewEncapsulation } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { HttpClient } from '@angular/common/http';\n\n@Component({\n selector: 'app-book-create',\n templateUrl: './book-create.component.html',\n styleUrls: ['./book-create.component.css'],\n encapsulation: ViewEncapsulation.None\n})\nexport class BookCreateComponent implements OnInit {\n\n book = {};\n\n constructor(private http: HttpClient, private router: Router) { }\n\n ngOnInit() {\n }\n\n saveBook() {\n this.http.post('/book', this.book)\n .subscribe(res => {\n let id = res['_id'];\n this.router.navigate(['/book-details', id]);\n }, (err) => {\n console.log(err);\n }\n );\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// /cube/angular-5/mean-stack/src/app/book-create/book-create.component.ts","exports = module.exports = require(\"../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"\", \"\"]);\n\n// exports\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = module.exports.toString();\n\n\n//////////////////\n// WEBPACK FOOTER\n// /cube/angular-5/mean-stack/src/app/book-detail/book-detail.component.css\n// module id = ../../../../../src/app/book-detail/book-detail.component.css\n// module chunks = main","module.exports = \"
\\n

{{ book.title }}

\\n
\\n
ISBN
\\n
{{ book.isbn }}
\\n
Author
\\n
{{ book.author }}
\\n
Publisher
\\n
{{ book.publisher }}
\\n
Price
\\n
{{ book.price }}
\\n
Update Date
\\n
{{ book.updated_at }}
\\n
\\n
\\n Edit\\n \\n Back\\n
\\n
\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// /cube/angular-5/mean-stack/src/app/book-detail/book-detail.component.html\n// module id = ../../../../../src/app/book-detail/book-detail.component.html\n// module chunks = main","import { Component, OnInit, ViewEncapsulation } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { ActivatedRoute, Router } from '@angular/router';\n\n@Component({\n selector: 'app-book-detail',\n templateUrl: './book-detail.component.html',\n styleUrls: ['./book-detail.component.css'],\n encapsulation: ViewEncapsulation.None\n})\nexport class BookDetailComponent implements OnInit {\n\n book = {};\n\n constructor(private router: Router, private route: ActivatedRoute, private http: HttpClient) { }\n\n ngOnInit() {\n this.getBookDetail(this.route.snapshot.params['id']);\n }\n\n getBookDetail(id) {\n this.http.get('/book/'+id).subscribe(data => {\n this.book = data;\n });\n }\n\n deleteBook(id) {\n this.http.delete('/book/'+id)\n .subscribe(res => {\n this.router.navigate(['/books']);\n }, (err) => {\n console.log(err);\n }\n );\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// /cube/angular-5/mean-stack/src/app/book-detail/book-detail.component.ts","exports = module.exports = require(\"../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"\", \"\"]);\n\n// exports\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = module.exports.toString();\n\n\n//////////////////\n// WEBPACK FOOTER\n// /cube/angular-5/mean-stack/src/app/book-edit/book-edit.component.css\n// module id = ../../../../../src/app/book-edit/book-edit.component.css\n// module chunks = main","module.exports = \"
\\n

Edit Book

\\n
\\n
\\n
\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n
\\n \\n
\\n
\\n
\\n
\\n
\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// /cube/angular-5/mean-stack/src/app/book-edit/book-edit.component.html\n// module id = ../../../../../src/app/book-edit/book-edit.component.html\n// module chunks = main","import { Component, OnInit, ViewEncapsulation } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { HttpClient } from '@angular/common/http';\n\n@Component({\n selector: 'app-book-edit',\n templateUrl: './book-edit.component.html',\n styleUrls: ['./book-edit.component.css'],\n encapsulation: ViewEncapsulation.None\n})\nexport class BookEditComponent implements OnInit {\n\n book = {};\n\n constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute) { }\n\n ngOnInit() {\n this.getBook(this.route.snapshot.params['id']);\n }\n\n getBook(id) {\n this.http.get('/book/'+id).subscribe(data => {\n this.book = data;\n });\n }\n\n updateBook(id) {\n this.http.put('/book/'+id, this.book)\n .subscribe(res => {\n let id = res['_id'];\n this.router.navigate(['/book-details', id]);\n }, (err) => {\n console.log(err);\n }\n );\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// /cube/angular-5/mean-stack/src/app/book-edit/book-edit.component.ts","exports = module.exports = require(\"../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"\", \"\"]);\n\n// exports\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = module.exports.toString();\n\n\n//////////////////\n// WEBPACK FOOTER\n// /cube/angular-5/mean-stack/src/app/book/book.component.css\n// module id = ../../../../../src/app/book/book.component.css\n// module chunks = main","module.exports = \"
\\n

\\n Book List\\n \\n \\n \\n

\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
Title 1AuthorAction
{{ book.title }}{{ book.author }}\\n Show Detail\\n \\n
\\n
\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// /cube/angular-5/mean-stack/src/app/book/book.component.html\n// module id = ../../../../../src/app/book/book.component.html\n// module chunks = main","import { Component, OnInit } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { ActivatedRoute, Router } from '@angular/router';\n\n@Component({\n selector: 'app-book',\n templateUrl: './book.component.html',\n styleUrls: ['./book.component.css']\n})\nexport class BookComponent implements OnInit {\n\n books: any;\n constructor(private router: Router, private route: ActivatedRoute, private http: HttpClient) { }\n\n ngOnInit() {\n this.http.get('/api/book').subscribe(data => {\n this.books = data;\n });\n }\n\n deleteBook(id) {\n this.http.delete('/book/'+id)\n .subscribe(res => {\n this.http.get('/book').subscribe(data => {\n this.books = data;\n });\n }, (err) => {\n console.log(err);\n }\n );\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// /cube/angular-5/mean-stack/src/app/book/book.component.ts","// The file contents for the current environment will overwrite these during build.\n// The build system defaults to the dev environment which uses `environment.ts`, but if you do\n// `ng build --env=prod` then `environment.prod.ts` will be used instead.\n// The list of which env maps to which file can be found in `.angular-cli.json`.\n\nexport const environment = {\n production: false\n};\n\n\n\n// WEBPACK FOOTER //\n// /cube/angular-5/mean-stack/src/environments/environment.ts","import { enableProdMode } from '@angular/core';\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n\nimport { AppModule } from './app/app.module';\nimport { environment } from './environments/environment';\n\nif (environment.production) {\n enableProdMode();\n}\n\nplatformBrowserDynamic().bootstrapModule(AppModule)\n .catch(err => console.log(err));\n\n\n\n// WEBPACK FOOTER //\n// /cube/angular-5/mean-stack/src/main.ts"],"sourceRoot":"webpack:///"} -------------------------------------------------------------------------------- /public/styles.bundle.js: -------------------------------------------------------------------------------- 1 | webpackJsonp(["styles"],{ 2 | 3 | /***/ "../../../../../src/styles.css": 4 | /***/ (function(module, exports, __webpack_require__) { 5 | 6 | // style-loader: Adds some css to the DOM by adding a