unter Code-Snippet platziert wird, funktioniert gut, wenn unter Vorlage URL-Seite platziert. Wenn wir es jedoch in separate js-Datei oder controler-Datei einfügen, funktioniert es nicht. Wie kann ich jquery in einer Controller-Datei hinzufügen?JQuery funktioniert nicht angularjs Controller-Datei. Funktioniert, wenn Code-Snippet intern
<script>
$(document).ready(function() {
$("#notificationLink").click(function() {
$("#notificationContainer").fadeToggle(300);
$("#notification_count").fadeOut("slow");
$('#notificationLink > i.fa-bell').addClass('fa-bell-o');
$('#notificationLink > i.fa-bell').removeClass('fa-bell');
return false;
});
//Document Click hiding the popup
$(document).click(function() {
$("#notificationContainer").hide();
});
//Popup on click
$("#notificationContainer").click(function() {
return false;
});
/* $('#AddNew').on('click', function() {
$('#notificationsBody ul').append('<li>New Message</li>');
});
*/
});
</srcipt>
Warum verwenden Sie nicht nur eckig dafür? – developer033