Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Error event on ngInclude is needed. #5803

Closed
jcdalton2201 opened this issue Jan 14, 2014 · 4 comments
Closed

Error event on ngInclude is needed. #5803

jcdalton2201 opened this issue Jan 14, 2014 · 4 comments

Comments

@jcdalton2201
Copy link

It would be nice to have $includeContentErrorRequested or something like it for ng-include so we would know if the error path on the $http if fired.

@caitp
Copy link
Contributor

caitp commented Jan 15, 2014

I don't think this is a totally desirable feature, but maybe. I have nothing better to do atm so I'll write up a quick implementation. Shouldn't take more than 10 minutes.

caitp added a commit to caitp/angular.js that referenced this issue Jan 15, 2014
This adds a scope event notification when a template fails to load.

This can have performance implications, and unfortunately cannot at this moment
be terminated with preventDefault(). But it's nice to be notified when problems
occur!

Closes angular#5803
@jcdalton2201
Copy link
Author

The reason we would like it is that we have a ng-include that serves up a page created from asp. if we get a 404 nothing displays in our frame and we would like to display a message at this time. We don't want to do the http interceptor because it is only in this one page. and not all of the request would need this. we made the change on our local version of angular 1.2.7 and it seems to work fine.
Thank you,Jason Dalton
Date: Wed, 15 Jan 2014 13:42:46 -0800
From: notifications@github.com
To: angular.js@noreply.github.com
CC: jcdalton@hotmail.com
Subject: Re: [angular.js] Error event on ngInclude is needed. (#5803)

I don't think this is a totally desirable feature, but maybe. I have nothing better to do atm so I'll write up a quick implementation. Shouldn't take more than 10 minutes.


Reply to this email directly or view it on GitHub.

@IgorMinar
Copy link
Contributor

as much as I don't like adding more stuff to ngInclude, it is true that we already have support for onload.

@ubenzer
Copy link

ubenzer commented Mar 18, 2014

To track whether content loading is a success or a failure (to handle failures in a special way for that include) it'd be nice to have this feature. Right now, I guess we have no way to know (except intercepting requests.

caitp added a commit to caitp/angular.js that referenced this issue May 15, 2014
This adds a scope event notification when a template fails to load.

This can have performance implications, and unfortunately cannot at this moment
be terminated with preventDefault(). But it's nice to be notified when problems
occur!

Closes angular#5803
@caitp caitp closed this as completed in e4419da Jun 10, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants