Open bonusskate opened 5 years ago
There is a bug with lazy loading on angular six
these are the solutions to some errors encountered
///in app-routing.module.ts
import { AdminModule } from 'app/admin/admin-module';
{ path: 'admin', loadChildren: () => AdminModule },
//tsconfig.app.json
"baseUrl": "./",
Md.... to Mat.... Changes Globally
// Requires Extra imports
import { MatInputModule } from '@angular/material';
Mat-Input-Container is now
<!-- app/admin/add-post.html !-->
<mat-form-field>
<input matInput [matDatepicker]="picker" placeholder="Choose a date" [(ngModel)]="newDate" (focus)="picker.open()">
<mat-datepicker-toggle [for]="picker"></mat-datepicker-toggle>
</mat-form-field>
<mat-datepicker #picker></mat-datepicker>
Not sure about this solution, but it seems to work it relates to rxjs observables The error was this
ERROR in src/app/admin/admin-components/admin-dashboard/admin-dashboard.component.ts(33,5): error TS2322: Type 'Observable<{}>' is not assignable to type 'Observable<any[]>'.
Type '{}' is not assignable to type 'any[]'.
Property 'includes' is missing in type '{}'.
The solution
///instead of
posts: Observable<any[]>;
//Working
posts: Observable<any>;
Package Lock
{
"name": "testapp2",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^6.1.0",
"@angular/cdk": "^6.1.0",
"@angular/common": "^6.1.0",
"@angular/compiler": "^6.1.0",
"@angular/core": "^6.1.0",
"@angular/fire": "^5.1.1",
"@angular/forms": "^6.1.0",
"@angular/http": "^6.1.0",
"@angular/material": "^6.1.1",
"@angular/platform-browser": "^6.1.0",
"@angular/platform-browser-dynamic": "^6.1.0",
"@angular/router": "^6.1.0",
"@ng-select/ng-select": "^2.13.1",
"core-js": "^2.5.4",
"firebase": "^5.7.0",
"hammerjs": "^2.0.8",
"ng2-ckeditor": "^1.2.2",
"ng2-dnd": "^5.0.2",
"rxjs": "^6.0.0",
"rxjs-compat": "^6.3.3",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.7.0",
"@angular/cli": "~6.1.0",
"@angular/compiler-cli": "^6.1.0",
"@angular/language-service": "^6.1.0",
"@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.2.1",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.0",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.3.0",
"ts-node": "~5.0.1",
"tslint": "~5.9.1",
"typescript": "~2.7.2"
}
}
Hope this helps cheers
I needed to migrate the app to angular 6+ in order to use @ng-select https://www.npmjs.com/package/@ng-select/ng-select
This migration has been problematic, current issues when using ng-serve Error TS2307
ng serve throws error TS2307 for every custom module non node-modules under app/... this was the case with angular 6 aswell
outdated unsupported depencencies
Resolved many of them by removing
`javascript 'app/ or adding
javascript ./But I still only get the issues for modules that are children of app/admin or app/storefront Another unresolved error
This is what I did so far migrated to angular.json
Migrated to @Angular/fire
Converted Md format into Mat type
Current Packagelock.json
Angular version and node version
Ng serve results