I wrote a simple javascript function that switches between two div elements. Like so:
function goToResults() {
document.getElementById("services").style.display = "none";
document.getElementById("results").style.display = "block";
}
As I am learning Angular, I want to convert that to an Angular function in app.js. Can I do the following?
$scope.goToResults = function () {
$scope.getElementById("services").style.display = "none";
$scope.getElementById("results").style.display = "block";
}
Thanks!
ng-style...ng-class...ng-if..ng-show...ng-hide...ng-switch.... all are driven by your data model