Below is the code so far
Something like this should do it:
myModel.text: myModel.text = {{myModel.text}} $pristine = {{myForm.$pristine}} $dirty = {{myForm.$dirty}} Set pristine
myModel.text = {{myModel.text}}
$pristine = {{myForm.$pristine}}
$dirty = {{myForm.$dirty}}
Note that the listener for $locationChangeStart isn't triggered in this example since AngularJS doesn't handle any routing in such a simple example, but it should work in an actual Angular application.