Reputation: 4637
This function in jquery
var someval = $('#someid').html();
if(someval !=""){
//something
}else{
//anything
}
How to write the same function in angularjs ?? I am a beginner in angular js. How to solve this ?? Can anyone provide me some example for this one ?
Upvotes: 1
Views: 52
Reputation: 2082
var someval = angular.element('#someid').html();
if(someval !=""){
//something
}else{
//anything
}
I hope It Helps !
Upvotes: 3
Reputation: 7666
you can do something like this in angular:
var someval = angular.element( document.querySelector( '#someid' ) ).html();
if(someval !=""){
//something
}else{
//anything
}
Upvotes: 0