"use strict"; angular.module("vocabulary") .component("wordSearchResults", { templateUrl: "/js/redesign-angular/wordSearch/word-search-results.html", controller: "WordSearchResultsController", bindings: { searchResults: "<", rootState: " 0; }; ctrl.matchingWordsExist = function() { return ctrl.searchResults.hasOwnProperty('matches') && ctrl.searchResults.matches.size() > 0; }; ctrl.relatedWordsExist = function() { return ctrl.searchResults.hasOwnProperty('related') && ctrl.searchResults.related.size() > 0; }; ctrl.goToAddNewWord = function() { var state = ctrl.rootState + ".wordSearch.results.new"; var url = $state.href(state, {}, {relative: '/'}).replace('#!', ''); accessRestriction.enforceRestriction(null, url) .then(function() { $state.go(state); }); } }]);