Adding javascript API to expose component variables