私はこの作業コード (以下) を持っています。これは機能し、適切に機能しますが、最適ではありません。$watch メソッドで書き直すのを手伝ってもらえますか? 私はいくつかの試みをしましたが、うまく いきませんでした。
function dialogWindows($scope) {
$scope.alpeic = [];
$scope.compute=function()
{
$scope.alpeic.push(1);
$scope.records = [
{id:0,
link:$scope.alpeic.length > 5 ? "alpeic.html" : "",
className:$scope.alpeic.length > 5 ? "special" : "normal",
item:"This is item A"},
{id:1,
link:$scope.alpeic.length > 5 ? "alpeic.html" : "",
className:$scope.alpeic.length > 5 ? "special" : "normal",
item:"This is item B"}];
}
$scope.compute();
}