The issue is textAngular in its core, expects a variable rangy
to be available globally (https://github.com/aaronroberson/textAngular/blob/master/src/main.js#L69).
So to fix this problem, we combined the rangy-core and rangy-selectionsaverestore into our window.rangy
at the beginning of the bootstrap of our application before we initialise the app with angular.module('appname', [modules...])
define(["angular", "ngRoute", "jquery", "rangy-core", "rangy-selectionsaverestore"], function(angular, ngRoute, $j, rangyCore, rangySelectionSavereStore) {
window.rangy = $j.extend(rangyCore, rangySelectionSavereStore);
});
Configuration for requirejs to load these two modules,
'rangy-core': '../bower_components/rangy/rangy-core',
'rangy-selectionsaverestore': '../bower_components/rangy/rangy-selectionsaverestore'