I'm interested in integrating Faye into an Ionic 2 project, but I'm struggling to figure out the correct way to add it. The official documentation at suggests using the 'require' syntax like this:
var faye = require('faye');
If I were serving the JavaScript from my web server, I could simply include a script tag pointing to the client.js file like so:
<script src='http://localhost:8000/faye/client.js'></script>
However, when attempting this approach in an Ionic 2 project, I encountered an issue with the importing process:
import { Faye } from 'faye';
//...
constructor(public navCtrl: NavController, platform: Platform, matchService: MatchService, faye : Faye) { //...
This code snippet results in the following error:
TypeScript error: Cannot find name 'Faye'
My question is, how can I properly use the 'import' statement to make the Faye Browser Client work within this Ionic 2 project?