Google Groups

Re: [angular.js] angular in zombie


Vojta Jína Jun 25, 2012 10:05 PM
Posted in group: AngularJS
Angular keeps reference on location.
It looks like zombie create new instance of location.

I guess zombie should behave the same as browsers do and they don't create new instance of location. It's still the same object. So that sounds like problem of zombie.
However, I think it wouldn't hurt if Angular always does location = window.location, as you described.

V.

On Wed, Jun 13, 2012 at 8:05 AM, Suller Andras <suller...@gmail.com> wrote:
Hi guys,

I tried zombie 1.3.1 in node 0.6.10 with angular 1.0rc12.
It has a problem with routing. When I tried to run the angular-seed
app in zombie, I got:

Error: 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: [["fn: $locationWatch;
newVal: 8; oldVal: 7"],["fn: $locationWatch; newVal: 9; oldVal:
8"],["fn: $locationWatch; newVal: 10; oldVal: 9"],["fn:
$locationWatch; newVal: 11; oldVal: 10"],["fn: $locationWatch; newVal:
12; oldVal: 11"]]

It turned out that Angular stores window.location attribute in the
$browser service, and it seems zombie replaces this object with a new
one sometimes, so Angular could not get the current location. I added
a "location = window.location;" statement to the beginning of
$browser.url method and this issue went away.

Is this is an Angular issue or a zombie issue?

I tried with angular 1.0rc10, the result is the same:
Error: 10 $digest() iterations reached. Aborting!

Andras

On Wed, Jan 11, 2012 at 4:35 AM, Tamas Herman <herma...@gmail.com> wrote:
> guys,
>
> im trying angualr from the zombie v0.12.11 headless browser running in node v0.6.6
>
> B = require('zombie')
> b = new B
> b.visit('http://127.0.0.1:8001/', { debug: true}, function(e, b){console.log(b.html())})
>
> the index.html under this url is served via express and it does work in chrome for example, but in zombie, i can't see the {{…}} templates processed.
>
> is there any special treatment required to run angular in zombie?
> am i missing something?
>
> --
>  tom
>
>
>
> ps: here is my index.html
>
> <!doctype html>
> <html xmlns:ng="http://angularjs.org">
> <head>
> <script src="http://code.angularjs.org/0.9.19/angular-0.9.19.min.js" ng:autobind></script>
> <script>
> AppController.$inject = ['$xhr']
> function AppController ($xhr) {
> var that = this
> this.$xhr = $xhr;
> this.$xhr.defaults.headers.post['Content-Type']='application/json';
> this.firms = {}
> this.firm_cnt = Object.keys(this.firms).length
> $xhr('GET', '/firms', function(code, res) { that.firms = res })
> }
> </script>
> </head>
> <body >
> <div ng:controller="AppController">
> {{firm_cnt}} Firms: <span ng:repeat="firm in firms">{{firm}}, </span>
> </div>
> </body>
> </html>
>
>
>
>
> --
> 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+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 "AngularJS" 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.