lundi 22 mai 2017

How can I include a pure javascript file into our ember application?

Our team is working on a new website that is going to use Algolia as our search engine. The problem is that there isn't an ember module that exists to use it (they are all old or unfinished).

Therefore, in order to use Algolia, we need to include a plain javascript file into our application. What is the best way to do this? We found that it works if we include the script into our index.html.

It looks something like this

index.html

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    

    

  </head>
  <body>
    

    <!-- Include Scripts Here -->
    <script src="algolia.js"></script>


    
  </body>
</html>

We are putting a javascript file into our index.html. While this seems to work I'm a little suspicious that this is not an ember solution to the problem. Are there other ways to include external javascript files to use throughout our program? Or is this solution fine as it is?




Aucun commentaire:

Enregistrer un commentaire