update demo code and directive.js