why registers to window? you can register to angular