fix($tooltip, $modal): double apply error in isolated scope (fixes #557)

hi, I'm not sure if I should fix one component at one time.
And I've added tests.