Try another way

try calling angular method by itself, and on html side, put script at
the last part