Use $timeout instead of setImmediate

We use $timeout instead of setImmediate to ensure that the placeholder is correctly initialized.