chore(website): fix watching for scope changes to update the souce code

And add unit tests for directive.