Search code examples
angularjsmigrationangularjs-1.6

Directive's passing parameter undefined while updating 1.5.x to 1.6 Angular


I have just updated the Angular 1.5.9 to 1.6.0. All merging things done in my project, but directive parameter which is passed as argument is not getting value in directive controller. As I find undefined after updating.

Please give some suggestion, how to solve this.


Solution

  • After long R&D on how to solve my error, I found solution for this migration from Angular migration guide. Here mentioned to use $onInit for component, but for directive also we have to use $onInit.

    Or you can place this in config file to allow for all application. $compileProvider.preAssignBindingsEnabled(true);

    So, I think this is helpful for others to solve the error on migration from 1.5 to 1.6.

    Thanks.