Code mirror submit method with AngularJS controller