I am writing unit testcase in angularjs for chipRemove in md-autocomplete.
please tell me location of md-autocomplete in git so that i will use it as a reference.
Further please observe the code snippet and post your suggetions
//code from controller file
$scope.chipRemove = function(chip, index) {
var autoChild = MyService.getAutoCompleteElement().firstElementChild;
//MyService.getAutoCompleteElement().firstElementChild is returning something like <md-autocomplete-wrap></md-autocomplete-wrap>
var el = angular.element(autoChild);
el.scope().$mdAutocompleteCtrl.scope.searchText = "";
//some logic goes here`
}
I am facing error in unit test case file where I am writing unit test case for chipRemove function as below.
[INFO] TypeError: el.scope(...) is undefined
Aucun commentaire:
Enregistrer un commentaire