Code Monkey home page Code Monkey logo

Comments (5)

diegonetto avatar diegonetto commented on September 25, 2024

So the issue here is that you're referencing a JS file hosted on the internet. It will work fine in development with grunt serve but the usemin blocks are used for building concatenated and minified files.

You have two options:

  1. If you want to make an external request to maps.google.com, move it out of the usemin build blocks.
  2. Download the maps JavaScript file and package it with your application and update your reference to point to a local file. This way when the build system runs, it will be able to compile a single vendor.js file with all your dependencies.

from generator-ionic.

tonyrh avatar tonyrh commented on September 25, 2024

Thanks Diego

from generator-ionic.

diegonetto avatar diegonetto commented on September 25, 2024

Glad to help :) Good luck with your project!

from generator-ionic.

marcolino avatar marcolino commented on September 25, 2024

Hi, Diego,
I have the same problem, here...
Your suggestions are very clear to me, but I can't have none of them to work...

  1. It would be my preferred solution: put the external request to maps.google.com out of the usemin build blocks... If i do
 <!-- build:js scripts/vendor.js -->
 <script src="//maps.googleapis.com/maps/api/js?sensor=false"></script>
 <!-- bower:js -->
 <script src="bower_components/jquery/jquery.js"></script>
 <script src="bower_components/angular/angular.js"></script>
 ...
 <!-- endbower -->
 <!-- endbuild -->

or even

<!-- build:js scripts/vendor.js -->
<!-- bower:js -->
<script src="bower_components/jquery/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
...
<!-- endbower -->
<!-- endbuild -->
<script src="//maps.googleapis.com/maps/api/js?sensor=false"></script>

I would expect to have a "<script src='//maps.googleapis.com/maps/api/js?sensor=false'></script>" in my dist index.html, but none is there...

  1. I did download the google maps script locally, but I don't get any reference to it in my dist index.html, but it's not there, either... But here probably I don't know exactly how to "package it with your application and update your reference to point to a local file"...

Can you give a hint?

from generator-ionic.

diegonetto avatar diegonetto commented on September 25, 2024

When I say package it with your application, I mean save it inside a
directory within your app (maybe /vendor or something).

Update your reference by adding a <script src="path/to/downloaded/file"></script> tag inside your usemin block
(outside of bower block, though).

On Sun, Apr 27, 2014 at 9:54 AM, marcolino [email protected] wrote:

Hi, Diego,
I have the same problem, here...
Your suggestions are very clear to me, but I can't have none of them to
work...

It would be my preferred solution: put the external request to
maps.google.com out of the usemin build blocks... If i do

...

or even

<script src="bower_components/jquery/jquery.js"></script> <script src="bower_components/angular/angular.js"></script>

...

<script src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>

I would expect to have a "" in my dist index.html, but none is there...

  1. I did download the google maps script locally, but I don't get any
    reference to it in my dist index.html, but it's not there, either... But
    here probably I don't know exactly how to "package it with your application
    and update your reference to point to a local file"...

Can you give a hint?


Reply to this email directly or view it on GitHubhttps://github.com//issues/39#issuecomment-41498711
.

from generator-ionic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.