original example code of Pro Angular JS