This library is only working if X2JS variable is defined in window. It is the case if you load manually all your dependencies in your HTML file with <script src="..."/> tags. But if you are using frameworks like webpack or Meteor you will face this issue:
ReferenceError: X2JS is not defined
The solution I've found is to remove the dependency on angular-x2js and switch to angular-x2js-wrapper.