Adding then directive.js.