define(["require", "exports"], function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var ProductController = /** @class */ (function () {
        function ProductController(API_URL) {
            this.API_URL = API_URL;
        }
        ProductController.prototype.gotoProduct = function () {
            location.pathname = "/catalog/product/view/id/" + this.product.id + "/";
        };
        ProductController.prototype.getAttribute = function (attribute_code) {
            var result = this.product.custom_attributes.find(function (item) { return item.attribute_code === attribute_code; });
            if (result) {
                return result.value;
            }
            else {
                return '';
            }
        };
        return ProductController;
    }());
    exports.ProductController = ProductController;
});
//# sourceMappingURL=product.controller.js.map