opitzconsulting / jquery-mobile-angular-adapter

jquery mobile angular adapter
MIT License
517 stars 114 forks source link

Empty project error #166

Closed mikekay01 closed 11 years ago

mikekay01 commented 11 years ago

The code displayed in the image below produces the below error: Uncaught TypeError: Cannot read property 'forEach' of undefined (jquery-mobile-angular-adapter.js:98)

Is there something obvious I'm missing? test

Sorry for sending an image, the html wouldn't paste correctly.

tbosch commented 11 years ago

Hi, you have to include at least one inline page in your app, e.g.

<body>
    <div data-role="page" id="start">
    </div>
</body>

Tobias

tbosch commented 11 years ago

Note that this is a know restriction, see the last point here: https://github.com/tigbro/jquery-mobile-angular-adapter#navigation-and-routes

mikekay01 commented 11 years ago

OK, I will try that. thanks, and sorry for not catching this previously.

mikekay01 commented 11 years ago

This is driving me nuts! I added a page, in fact I have a jquery Mobile page that works perfectly until I attempt to add my ng-controller="xxx" statement, and then I get an error:

SyntaxError: Unexpected string at Object.parse (native)

This is really a pain!

Is there anyone out there who has a working example of a simple project (no routes, etc.) that works with this adapter and the latest version of JQM?

I've been using Angular for over a year now so I'm not a complete novice, but this seems to be very difficult to integrate with the latest version of JQM.

tbosch commented 11 years ago

Hi, here is a very simple example from the Readme.md, using jquery mobile 1.3: http://jsfiddle.net/tigbro/Du2DY/

Please note that I haven't tested the adapter against jquery mobile 1.3.1 yet, so if you use that this could explain your problems...

Tobias

tbosch commented 11 years ago

Ah, and could you create a jsfiddle for your example? Then I could help with your concrete problem...

Tobias

mikekay01 commented 11 years ago

I'll take a look at it and report back with my observations... thanks... I very much want to use this adapter! It is perfect for my needs...

mikekay01 commented 11 years ago

I've been looking at the project and here's what seems to be happening...

If I place the remote script tag in my html everything works great.

https://github.com/tigbro/jquery-mobile-angular-adapter/raw/master/compiled/jquery-mobile-angular-adapter-standalone.js" type="text/javascript"

but if I try to replace the tag with a local script tag:

"js/jquery-mobile-angular-adapter.js" type="text/javascript"

I get the following error:

Uncaught TypeError: Cannot read property 'forEach' of undefined

I'm sure I'm using the latest version of the js file...