PacktPublishing / Angular-Router

Angular Router, published by Packt
MIT License
3 stars 7 forks source link

Error when upgrade to Angular 4 #1

Open rustan-id opened 7 years ago

rustan-id commented 7 years ago

[gmaimunah@ghina-id router_mailapp-master]$ ng serve NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:42 00 Hash: 82d017f7397e78bbb0d4 Time: 75080ms chunk {0} main.bundle.js, main.bundle.js.map (main) 27.8 kB {2} [initial] [rendered] chunk {1} styles.bundle.js, styles.bundle.js.map (styles) 10.5 kB {3} [initial] [rendered] chunk {2} vendor.bundle.js, vendor.bundle.js.map (vendor) 3.97 MB [initial] [rendered] chunk {3} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]

ERROR in /home/gmaimunah/Documents/Angular/Angular Router/AngularRouter_Code/router_m ailapp-master/src/app/mail.module.ts (81,109): Property 'forRoot' does not exist on type 'typeof Mater ialModule'.

ERROR in /home/gmaimunah/Documents/Angular/Angular Router/AngularRouter_Code/router_m ailapp-master/src/typings.d.ts (8,13): All declarations of 'Matchers' must have identical type paramet ers.

ERROR in /home/gmaimunah/Documents/Angular/Angular Router/AngularRouter_Code/router_m ailapp-master/node_modules/@types/jasmine/index.d.ts (397,15): All declarations of 'Matchers' must hav e identical type parameters.

ERROR in Error encountered resolving symbol values statically. Calling function 'MaterialModule', func tion calls are not supported. Consider replacing the function or lambda with a reference to an exporte d function, resolving symbol MailModule in /home/gmaimunah/Documents/Angular/Angular Router/AngularRouter_Code/router_mailapp-master/src/app/mail.module.ts, resolving symbol MailModule in /home/gmaimunah/Documents/Angular/Angular Router/AngularRouter_Code/router_mailapp-m aster/src/app/mail.module.ts webpack: Failed to compile.

rustan-id commented 7 years ago
This is my package.son :
{
  "name": "booknew",
  "version": "0.0.0",
  "license": "MIT",
  "angular-cli": {},
  "scripts": {
    "start": "ng serve",
    "lint": "tslint \"src/**/*.ts\"",
    "test": "ng test",
    "pree2e": "webdriver-manager update",
    "e2e": "protractor"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^4.2.2",
    "@angular/common": "^4.2.2",
    "@angular/compiler": "^4.2.2",
    "@angular/compiler-cli": "^4.2.2",
    "@angular/core": "^4.2.2",
    "@angular/forms": "^4.2.2",
    "@angular/http": "^4.2.2",
    "@angular/material": "2.0.0-beta.6",
    "@angular/platform-browser": "^4.2.2",
    "@angular/platform-browser-dynamic": "^4.2.2",
    "@angular/platform-server": "^4.2.2",
    "@angular/router": "^4.2.2",
    "@types/hammerjs": "^2.0.32",
    "core-js": "^2.4.1",
    "hammerjs": "^2.0.8",
    "rxjs": "5.4.0",
    "ts-helpers": "^1.1.1",
    "zone.js": "^0.8.12"
  },
  "devDependencies": {
    "@angular/cli": "^1.1.1",
    "@types/jasmine": "^2.2.30",
    "codelyzer": "~3.0.1",
    "jasmine-core": "2.6.3",
    "jasmine-spec-reporter": "4.1.0",
    "karma": "1.7.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-remap-istanbul": "^0.6.0",
    "protractor": "5.1.2",
    "ts-node": "3.0.6",
    "tslint": "5.4.3",
    "typescript": "^2.3.4",
    "webpack": "2.6.1"
  }
}
rustan-id commented 7 years ago
angular-cli.json:

{
    "project": {
        "version": "1.0.0-beta.24",
        "name": "testapp"
    },
    "apps": [{
        "root": "src",
        "outDir": "dist",
        "assets": [],
        "index": "index.html",
        "main": "main.ts",
        "test": "test.ts",
        "tsconfig": "tsconfig.json",
        "prefix": "app",
        "mobile": false,
        "styles": [
            "styles.css"
        ],
        "scripts": [],
        "environmentSource": "environments/environment.ts",
        "environments": {
            "dev": "environments/environment.ts",
            "prod": "environments/environment.prod.ts"
        }
    }],
    "addons": [],
    "packages": [],
    "e2e": {
        "protractor": {
            "config": "./protractor.conf.js"
        }
    },
    "test": {
        "karma": {
            "config": "./karma.conf.js"
        }
    },
    "defaults": {
        "styleExt": "css",
        "prefixInterfaces": false,
        "inline": {
            "style": false,
            "template": false
        },
        "spec": {
            "class": false,
            "component": true,
            "directive": true,
            "module": false,
            "pipe": true,
            "service": true
        }
    }
}