AngularJS not supported?

Manish Kumar Mar 03, 2014 09:57AM PST

I think your solution does not support single page apps right now. Is there any way your 'crawler' can see our content correctly and so that I can format the mobile site correctly?

Up -1 rated Down
Jennifer Mar 03, 2014 11:19AM PST Mobify Agent

Hello,

When you say our crawler isn’t seeing your content correctly, are you referring to our Performance Suite not resizing your images? If not could you provide a bit more information on the issue you’re seeing.

Thanks,
Jennifer

Up 3 rated Down
Manish Kumar Mar 03, 2014 07:41PM PST
I'm referring to your studio suite. It doesn't show me the site content in its 'content selector'. The site content completely runs on AJAX as you would know happens in AngularJS.
Any solution for that?
Up 0 rated Down
Jennifer Mar 04, 2014 10:37AM PST Mobify Agent

Hello,

Unfortunately there isn’t a good way of getting around this. We disable Javascript for your site within the content selector, because most of the Mobify.js code will run before any Javascript on your site has run. By disabling Javascript in the selector tool you are able to see the page in the state it will be when Mobify runs your selectors. You may still be able to use Mobify Studio for your site, but the selector tool will not be very useful.

If you are able to select and add the HTML elements your AngularJS code requires to your mobile templates, you could add the AngularJS scripts to your templates as well, and the code will run when the Mobile template is rendered.

For instance, if you had a header div that AngularJS loaded with some content you could add the header div to your mobile template with a selection. Perhaps something like this:

Selector Name: headerContainer
CSS Selector: #header

Then add {headerContainer} to your template file.

You’ll also need to include your desktop scripts on your mobile templates. By default Mobify Studio excludes desktop scripts. To add them simply add the {script} key to your base template file.

More on using Javascript with Mobify Studio can be found here.

Hope this helps,
Jennifer

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)
support@mobify.me
https://cdn.desk.com/
mobify
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
Invalid characters found
/customer/en/portal/articles/autocomplete