The problem here is: the Jade evaluation will be completed before Angular is initialized.
Therefore you cannot mix it!
Jade ? JavaScript ?
, Angular, DOM Jade , , Jade.
, , Jade Angular .
Angular, ng-call - pewudo Angular, , node:
script.
var getNotificationType = function(notification) {
return notification.typeOfNotification
}
var typeIsLike = function(n) {
var type = getNotificationType(n);
if (type === 'like') {
return 'LIKED';
}
return 'ELSE';
}
var foo = "bar";
ol
li(ng-repeat = "notification in notificationData")
p(ng-call = "getNotificationType(notification)")
p(ng-call = "typeIsLike(notification)")
BTW: p= typeOfNotification p #{ typeOfNotification }
( ;)