Replace vm with $scope