Storing the directive's state on an object