Some modification to drawingboard.js for use in angular