add function which change mode for angular.