--
You received this message because you are subscribed to the Google Groups "angular" group.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/angular?hl=en.
--
You received this message because you are subscribed to the Google Groups "angular" group.
To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/2HtEKLE4_qwJ.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/angular?hl=en.
We are converting docs.angularjs.org to the html5 mode. It's done and needs to be merged to master. Check out the pending pull request in the meantime.
/i
Does html5 mode support onbeforeunload ?
Thanks,
Boris.
On Mon, 05 Sep 2011 13:06:08 -0700, Vojta Jina <vojta...@gmail.com>
wrote:
Can you be more specific?
/i
Regular HTML has javascript onbeforeunload, which will confirm with user
on page change.
Example: a user has made changes to form data and tries to navigate away
without saving, the script will confirm whether the user wants to save the
data before reloading or loading another page.
It was not possible to implement something like this in user space with
old $route/$location, so I'm wondering if HTML5 history API supports
onbeforeunload equivalent natively, or maybe it was accounted for in the
new AngularJS implementation?
Thank you,
Boris.
On Fri, 23 Sep 2011 09:24:49 -0700, Igor Minar <igor....@gmail.com>
wrote:
> Can you be more specific?
>
> /i
> On Sep 23, 2011 5:49 PM, "Boris Gurvich" <uni...@gmail.com> wrote:
>> Hi Voita,
>>
>> Does html5 mode support onbeforeunload ?
>>
>> Thanks,
>> Boris.
>>
>> On Mon, 05 Sep 2011 13:06:08 -0700, Vojta Jina <vojta...@gmail.com>
>> wrote:
>>
<snip>
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+unsubscribe@googlegroups.com.
window.onbeforeunload takes care of page reload, window/tab close, and
change of URL.
It doesn't trigger on hash change, and $route.onChange() is too late to
catch user confirm action, because all logic of hash change has been done
already.
We had a conversation about it previously in this thread:
http://groups.google.com/group/angular/browse_thread/thread/f64e5a14fa33dd1a/57e2670aede35eef
Yesterday I've just opted not to use <a href="..."> at all or changing
$location hash directly, and implemented goTo(url) service method that
takes care of this, so this RFE is not a priority at all. This workaround
doesn't handle direct change of hash in address bar, but I can live with
it.
Thanks,
Boris.
<snip>
>>
<snip>
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups
>> "AngularJS" group.
>> To post to this group, send email to ang...@googlegroups.com.
>> To unsubscribe from this group, send email to angular+unsubscribe@**
>> googlegroups.com <angular%2Bunsu...@googlegroups.com>.
>> For more options, visit this group at http://groups.google.com/**
>> group/angular?hl=en <http://groups.google.com/group/angular?hl=en>.
>>
>>
>
Igor,
window.onbeforeunload takes care of page reload, window/tab close, and change of URL.
It doesn't trigger on hash change, and $route.onChange() is too late to catch user confirm action, because all logic of hash change has been done already.
group/angular?hl=en <http://groups.google.com/group/angular?hl=en>.
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/angular?hl=en.
> On Tue, Sep 27, 2011 at 5:36 AM, Boris Gurvich <uni...@gmail.com> wrote:
>
>> Igor,
>>
>> window.onbeforeunload takes care of page reload, window/tab close, and
>> change of URL.
>>
>> It doesn't trigger on hash change, and $route.onChange() is too late to
>> catch user confirm action, because all logic of hash change has been
>> done
>> already.
>>
>
> in 0.10.x we have "$beforeRouteChange" event that is fired before the
> route
> is changed,
Thanks. Right now I'm still on 0.9.16, the code doesn't work even on
0.9.19, and I'm just waiting for 1.0 to upgrade API integration.
The app is huge, so I have to minimize exposure to moving API target.
> are you also looking for real "window.onbeforeunload" event in
> addition to this event?
Yes, I've implemented handling both browser navigator and angular hash nav
events. If it is of an interest to anyone, I can isolate the
implementation and share.
On Tue, 27 Sep 2011 05:49:01 -0700, Igor Minar <ig...@angularjs.org> wrote:Thanks. Right now I'm still on 0.9.16, the code doesn't work even on 0.9.19, and I'm just waiting for 1.0 to upgrade API integration.
On Tue, Sep 27, 2011 at 5:36 AM, Boris Gurvich <uni...@gmail.com> wrote:
Igor,
window.onbeforeunload takes care of page reload, window/tab close, and
change of URL.
It doesn't trigger on hash change, and $route.onChange() is too late to
catch user confirm action, because all logic of hash change has been done
already.
in 0.10.x we have "$beforeRouteChange" event that is fired before the route
is changed,
The app is huge, so I have to minimize exposure to moving API target.
Yes, I've implemented handling both browser navigator and angular hash nav events. If it is of an interest to anyone, I can isolate the implementation and share.
are you also looking for real "window.onbeforeunload" event in
addition to this event?
I didn't find any doc on it, does $beforeRouteChange allow canceling the
route change?
If yes, i think that's flexible enough for any purpose.