javascriptangularjscordovaemojione

Correct way to access emojione in angular controller


I have a PhoneGap App with AngularJs 1.5.5, OnsenUI 2 and EmojiOne.

I am trying to access the emojione variable inside of the angular controller:

ons.bootstrap.controller('AppController', ['$scope', '$timeout','$http', '$sce', function ($scope, $timeout, $http, $sce) {

    emojione.imageType = 'svg';
    emojione.sprites = true;
    emojione.imagePathSVGSprites = '../res/sprites/emojione.sprites.svg';
    ...

I have some function calls later on as well.

It is working as intended when i run it on my PC, but fails to resolve "emojione" (it is undefined) on android. This is my first time working with angularjs and JavaScript so it may be something really simple.


Solution

  • Are you loading emojione library from a cdn? Mobile has internet access?