feat(input): add $setDirty method to the controller of ng-model directive

- extract existing functionality to public method: $setDirty
- add tests to corresponding changes
- refactor code to use extracted method

Closes #10038