You should be able to do whatever it is you want to do not by focusing on the string inside the ng-switch
element but by the property that changes what ng-switch displays and do everything inside your ng-click
and get rid of using jQuery for this.
Change ng-click
to pass in the whole contact object, not just the userID
<a class="contacts" ng-click="contactSelect(contact)">
Then in controller I will assume that the ng-switch
is related to the contact
object:
var switchValues =['one','two','three'];// if not in this array will use default
$scope.contactSelect = function(contact){
var userId = contact.userId;
// do something with the userId
var switchValue = contact.switchProperty;
// do something with the switchProperty
if(switchValues.indexOf(switchValue ) === -1){
// this will be default case with string "hello world" in the dom
// do whatever you would have done in the jQuery
}
}
This is very rough since not much detail was provided in the question