ariatemplates/hashspace — pull request #139 by b-laporte (2014-04-19 21:49:23+00:00)
Title: fix refresh for components created in dirty state

This PR fixes a refresh issue that @divdavem found in one of his applications.

The problem occurs when an {if} statement changes its content, and when the new content contains a component that is created in dirty state. As {if} assumed content was always created in a clean state, it used to set itself to `cdirty=false` - which broke the refresh chain, and made subsequent refresh impossible.

Now you may wonder how to create a component in dirty state? Actually since the new observation rules associated to function containing expressions it is possible to create a component and set it dirty right after its $init(). For this you need to call a callback in the init, and change an object that is indirectly observed by the component (e.g. a function context - cf. new tests in the PR)