convert example to using angular