Make change inside app.config() in angularjs

前端 未结 2 1569
情书的邮戳
情书的邮戳 2021-01-23 10:39

I am using googlePlace api in angularJs and I want to change type of places dynamically as needed. Like I use controllers to bind the values in view part using $scope but it\'s

2条回答
  •  生来不讨喜
    2021-01-23 11:20

    I found a different way to solve this problem. You don't need to extra just pass the types:[] as an argument in 'nearBySearch' function

    $scope.data = ngGPlacesAPI.nearbySearch({latitude:ll.lat(), longitude:ll.lng(), types:[$scope.business.selected.businessType]}).then(
        function(data){
    		$scope.person=data;
    		console.log(data);
    	  return data;
        });

    "$scope.business.selected.businessType" is bindable dynamically from view, that's it.

提交回复
热议问题