fix(uiView): add `$element` to locals for view controller

Closes issue #1657