diff --git a/VIEW_CODE/js/README.md b/VIEW_CODE/js/README.md index 88480d7..65aabe9 100644 --- a/VIEW_CODE/js/README.md +++ b/VIEW_CODE/js/README.md @@ -138,23 +138,23 @@ for the `prmSearchBarAfter` directive ``` controller: 'MyInstitutionComponentController', ``` -- Define a controller with 2 getter methods to return the query and selected scope +- Define a controller with 2 getter methods to return the query and selected scope. In order to access the parentCtrl binding, the controller must implement the ngOnInit life cycle hook. ``` app.controller('MyInstitutionComponentController', [function () { - var vm = this; + this.$onInit = function () { - vm.getSelectdScope = getSelectdScope; - vm.getQuery = getQuery; + var vm = this; + vm.getSelectedScope = function() { + return vm.parentCtrl.scopeField; + } - function getSelectdScope() { - return vm.parentCtrl.scopeField; + vm.getQuery = function() { + return vm.parentCtrl.mainSearchField; + } } - function getQuery() { - return vm.parentCtrl.mainSearchField; - } }]); ``` @@ -171,7 +171,7 @@ template: `