Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

$onInit hook from Angular 1.5.0 will not fire for ModalInstance controller #5472

Closed
radek-anuszewski opened this issue Feb 12, 2016 · 5 comments

Comments

@radek-anuszewski
Copy link

Of course I have in mind that, at this moment, Angular 1.5.0 is not officially supported:

AngularJS (requires AngularJS 1.4.x, tested with 1.4.9)

But have I decided anyway to submit an issue about new $onInit hook problem. The problem is that it will not fire for modal instance controller (specified with controller and controllerAs options for open method). Here is plunker forked from your demo pego which shows an issue: $onInit will not fire for modal instance controller. Some content has been removed, Angular CDN have been updated to use 1.5.0 version and controllerAs syntax has been used.

Update:
Of course problem does not exists with current supported Angular version (1.4.9), because hook is available in 1.5.0 version

@icfantv
Copy link
Contributor

icfantv commented Feb 12, 2016

@radek-anuszewski are you saying that it IS working for 1.4.9? Thanks.

@Foxandxss
Copy link
Contributor

No

@Foxandxss
Copy link
Contributor

I didn't know about this feature so we will take a peek

@radek-anuszewski
Copy link
Author

@icfantv No, it's not working for 1.4.9, because there is no this hook in 1.4.9

@wesleycho
Copy link
Contributor

Looks like we have to implement this manually since we copied over the API for bindToController.

This would be an easy PR if you want to try tackling it quickly. Basically this requires some logic like this to be implemented after here. Otherwise, one of us could probably implement it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants