seperated demo JavaScript from directive code