You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Angular official skills are calling functions in the templates #70132
I can confirm this. A few days ago, while writing a skeleton component to iterate through rows using GPT 5.6 Luna (Medium), I used to put a function in a @for or @if loop. Should we possibly specify this in some best practices guidelines?
As additional information: the project was completely new in Angular 21, using signals; there was no use of functions in the template to justify the agent following a project pattern.
angular-developer ... it is general problem that eslint is not respected ...
It wouldn't be a problem with the skill itself; I don't think the skill indicates or recommends using functions in the template, but it should specify that it's not recommended in that case.
In the world of OnPush by default, and zoneless, calling a function might be fine depending on what the functions actually do.
I agree with this. If we use zoneless and OnPush, it shouldn’t be problematic. The issue usually comes when we have some rule configured, and IIRC, it wasn’t recommended at the time. IMO, it would be good to specify this.
Perhaps, the reason for such errors by LLMs is that a signal is the same as a function call, eg:
comp.html
<p>{{ foo() }}</p>
foo is a signal or a function? The only way to know is read the typescript. This might lead LLMs to believe that using functions in HTML is legitimate.
Activity
JeanMeche commentedon Aug 9, 2026
Which skill is calling function in the templates ?
Celtian commentedon Aug 9, 2026
angular-developer... it is general problem that eslint is not respected ...SkyZeroZx commentedon Aug 9, 2026
I can confirm this. A few days ago, while writing a skeleton component to iterate through rows using GPT 5.6 Luna (Medium), I used to put a function in a
@foror@ifloop. Should we possibly specify this in some best practices guidelines?As additional information: the project was completely new in Angular 21, using signals; there was no use of functions in the template to justify the agent following a project pattern.
It wouldn't be a problem with the skill itself; I don't think the skill indicates or recommends using functions in the template, but it should specify that it's not recommended in that case.
cesco69 commentedon Aug 10, 2026
same for me, happen multiple times
JeanMeche commentedon Aug 10, 2026
There isn't a clear cut here.
In the world of OnPush by default, and zoneless, calling a function might be fine depending on what the functions actually do.
There isn't an official recommendation to not call functions in templates. And actually signals invocations are functions calls.
alxhub commentedon Aug 10, 2026
Do you have examples of functions that agents are writing and calling in templates that they shouldn't?
Celtian commentedon Aug 10, 2026
Here is the example
Celtian/qdb-converter@17f1ce4
it happened in multiple repos ...
SkyZeroZx commentedon Aug 10, 2026
This is a brief summary of the component I mentioned earlier. The only additional information is that it uses Angular v21, and Zoneless.
I agree with this. If we use zoneless and OnPush, it shouldn’t be problematic. The issue usually comes when we have some rule configured, and IIRC, it wasn’t recommended at the time. IMO, it would be good to specify this.
cesco69 commentedon Aug 13, 2026
Perhaps, the reason for such errors by LLMs is that a signal is the same as a function call, eg:
comp.html
foo is a signal or a function? The only way to know is read the typescript. This might lead LLMs to believe that using functions in HTML is legitimate.
martin-juul commentedon Aug 13, 2026
This is also applicable to codebases before signals. Claude for example explicitly needs to be told to create pipes.
One could argue pipes are awkward, and the trackFn should be able to do the job. But it's not as natural to use as key and :key in react/vue
docs: add guidance against calling methods in templates