{"size": 684, "ext": "js", "max_stars_repo_path": "app/views/properties-search/property-item/property-item.ctrl.js", "max_stars_repo_name": "yotamsha/guesty-frontend", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/views/properties-search/property-item/property-item.ctrl.js", "max_issues_repo_name": "yotamsha/guesty-frontend", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/views/properties-search/property-item/property-item.ctrl.js", "max_forks_repo_name": "yotamsha/guesty-frontend", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 34.2, "max_line_length": 95, "alphanum_fraction": 0.5497076023}
/**
 * Created by yotam on 16/05/2017.
 */
angular.module('myApp.properties-search')
    .controller('PropertyItemCtrl', ['$scope', '$mdDialog', 'propertyData', 'AirbnbAPIService',
        function ($scope, $mdDialog, propertyData, AirbnbAPIService) {
            var ctrl = this;
            ctrl.dataLoaded = false;
            ctrl.reviews = [];
            ctrl.propertyData = propertyData.listing;
            AirbnbAPIService.getReviewsById(ctrl.propertyData.id).then(function(data){
                ctrl.reviews = data;
                ctrl.dataLoaded = true;
            });
            ctrl.close = function() {
                $mdDialog.hide();
            };
        }]);

