seperated demo JavaScript from directive code
Merge pull request #1 from hrgui/master

seperated demo JavaScript from directive code