<commit_before>var opbeatCore = require('opbeat-js-core')
var ServiceFactory = opbeatCore.ServiceFactory
var angularInitializer = require('./angularInitializer')
require('zone.js')
function init () {
  var serviceFactory = new ServiceFactory()
  angularInitializer(serviceFactory)
}

init()<commit_msg>feat(opbeat-angular): check for global serviceFactory<commit_after>var opbeatCore = require('opbeat-js-core')
var ServiceFactory = opbeatCore.ServiceFactory
var angularInitializer = require('./angularInitializer')

require('zone.js')
function init () {
  var serviceFactory = new ServiceFactory()
  if (window.opbeatApi && window.opbeatApi.serviceFactory) {
    serviceFactory = window.opbeatApi.serviceFactory
  }
  angularInitializer(serviceFactory)
}

init()
{'fraction_non_alphanumeric': 0.1127129750982962, 'fraction_numerical': 0.0, 'mean_word_length': 6.717171717171717, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6235707', 'n_tokens_mistral': 213, 'n_tokens_neox': 212, 'n_words': 44}