I'm still in process learning Angular.
For my current project I need to display HTML (eg: <h1>note1</h1><span>my first note</span><br><h1>note2</h1><span>my second note</span>) in my view. I know everyone will suggest to use ng-bind-html, but that is not what I want.
What I want is, i want to do checking if string HTML have note2 then display my second note.
In controller I know how to find string note2 which is use .match.
JSON
items =
[
{
"description": "<h1>note1</h1><span>my first note</span><br><h1>note2</h1><span>my second note</span>"
}
]
In controller find String note2
angular.forEach(items, function(value, key) {
if (value.description.match("note2")) {
console.log(value.description);
// will output HTML <h1>note1</h1><span>my...
}
else {
console.log("string not found");
}
});
I can do till find String note2, but to display my second note I don't have any idea.
Can someone help me with this, thanks..
items.descriptiontovalue.description?