Skip to content

minutebase/ember-inject-script

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
app
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

ember-inject-script

Inject 3rd party scripts into your ember-cli app, for example mixpanel, Typekit etc...

Installation

Install as an Ember CLI addon:

npm install --save-dev ember-inject-script

Usage

For example, lets configure Typekit.

loadScript returns a promise, so we can simply load in the Typekit JS and, when it's ready, call Typekit.load():

/* global Typekit */

import injectScript from 'ember-inject-script';
import config from 'your-app/config/environment';

export default {
  name: 'typekit',
  initialize: function() {
    var url = "//use.typekit.net/"+config.typekitID+".js";
    injectScript(url).then(function() {
      Typekit.load();
    });
  }
};

Developing

Installation

  • git clone this repository
  • npm install
  • bower install

Running

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.

About

Easily inject 3rd party scripts in ember-cli apps

Resources

License

Stars

Watchers

Forks

Packages

No packages published