Fixed AngularJS scope issue with primite