Revert "add $setDirty function"

This reverts commit 2de5fdc6425e7abc2a5e958c3c1d74bf3cf24ab5.
Revert "Revert "add $setDirty function""

This reverts commit dd20c222c3ee6e9973065b79cab0eacdcc29130c.