1

Hi My team and I have updated our angular app from 4.3.2 to angular 7.1.3. All packages migrated and angular.json pointing to the same. But in console we receive "Can't bind to 'ngOutletContext'". No where in the app this attribute is used. It only appears in Vendor.js. Error message is below.

compiler.js:2427 Uncaught Error: Template parse errors: Can't bind to 'ngOutletContext' since it isn't a known property of 'ng-template'. 1. If 'ngOutletContext' is an Angular directive, then add 'CommonModule' to the '@NgModule.imports' of this component. 2. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. (" ][ngOutletContext]="day.context"> "): ng:///NgbDatepickerModule/NgbDatepickerMonthView.html@13:58 Property binding ngOutletContext not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the "@NgModule.declarations". (" [class.hidden]="isHidden(day)"> [ERROR ->] "): ng:///NgbDatepickerModule/NgbDatepickerMonthView.html@13:12 at syntaxError (compiler.js:2427) at TemplateParser.push.../node_modules/@angular/compiler/fesm5/compiler.js.TemplateParser.parse (compiler.js:20311) at JitCompiler.push.../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._parseTemplate (compiler.js:25857) at JitCompiler.push.../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._compileTemplate (compiler.js:25844) at compiler.js:25787 at Set.forEach () at JitCompiler.push.../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._compileComponents (compiler.js:25787) at compiler.js:25697 at Object.then (compiler.js:2418) at JitCompiler.push.../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._compileModuleAndComponents (compiler.js:25696) 1. If 'ngOutletContext' is an Angular directive, then add 'CommonModule' to the '@NgModule.imports' of this component

Current Angular setup is.

"devDependencies": {
    "@angular-devkit/build-angular": "^0.11.3",
    "@angular/cli": "^7.1.3",
    "@angular/compiler-cli": "^7.1.3",
    "@biesbjerg/ng2-translate-extract": "^0.6.0",
    "@types/core-js": "^0.9.43",
    "@types/geojson": "^1.0.6",
    "@types/highcharts": "^5.0.12",
    "@types/jasmine": "^2.5.47",
    "@types/jspdf": "^1.1.31",
    "@types/leaflet": "^0.7.31",
    "@types/lodash": "^4.14.61",
    "@types/node": "^7.0.12",
    "codelyzer": "2.1.1",
    "core-js": "^2.5.1",
    "env2json": "^1.0.0",
    "hads": "1.3.3",
    "htmlhint": "0.9.13",
    "https-proxy-agent": "^1.0.0",
    "jasmine-core": "2.5.2",
    "jasmine-spec-reporter": "^3.2.0",
    "karma": "^1.5.0",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.0.0",
    "karma-jasmine": "^1.1.0",
    "karma-junit-reporter": "^1.2.0",
    "karma-phantomjs-launcher": "^1.0.2",
    "lite-server": "^2.3.0",
    "phantomjs-prebuilt": "^2.1.14",
    "protractor": "~5.1.0",
    "stylelint": "7.10.1",
    "stylelint-config-standard": "16.0.0",
    "ts-node": "3.0.2",
    "tslint": "~4.5.0",
    "typescript": "3.1.6"
  }
Aditya
  • 67
  • 1
  • 12
  • possible duplicate https://stackoverflow.com/questions/47221088/cant-bind-to-ngoutletcontext-since-it-isnt-a-known-property-of-ng-template – Suresh Kumar Ariya Dec 19 '18 at 07:00
  • @SureshKumarAriya As indicated in the description no where in the code the [ngOutletContext] is present. We have looked everywhere. The above question answers to change the tag. Here in our app we do not have the tag anywhere. – Aditya Dec 19 '18 at 09:03

1 Answers1

0

Replace ngOutletContext with ngTemplateOutletContext.

its mentioned in angular update guide. for complete details visit

https://update.angular.io/
Akshay Rajput
  • 1,978
  • 1
  • 12
  • 22
  • We have used both angular.io/cli/update and update.angular.io for our migration. In VS Code search no where we can find "ngOutletContext " – Aditya Dec 19 '18 at 09:07
  • read the error ng:///NgbDatepickerModule/NgbDatepickerMonthView.html@13:58 Property binding ngOutletContext not used by any directive on an embedded template.........., are you using a third-party library, for DatePicker I guess the issue might be over there – Akshay Rajput Dec 19 '18 at 09:40