#Strange problem with Angular

10 messages · Page 1 of 1 (latest)

modest grove
#

password-change.component.ts

import {Component} from '@angular/core';
import {TranslateModule} from '@ngx-translate/core';
import {PasswordChangeFormComponent} from '@myhabbo/ui/components';

@Component({
  selector: 'password-change',
  templateUrl: './password-change.component.html',
  styleUrls: ['./password-change.component.scss'],
  standalone: true,
  imports: [
    TranslateModule,
    PasswordChangeFormComponent,
  ],
})
export class PasswordChangeComponent {
}

password-change.component.html

<h2 translate="PASSWORD_CHANGE_TITLE"></h2>
<password-change-form></password-change-form>
#

All of my components are standalone

raw pagoda
#

your component selector is password-change but your template uses password-change-form, they should match probably unless you left some stuff out

terse crown
#

Not seeing anything obvious wrong with the code you shared. This line in the error is probably what you need to look at at PasswordChangeComponent_Template (password-change.component.html:1:1). Have you tried commenting out the first line in the html (e.g. <h2 translate="PASSWORD_CHANGE_TITLE"></h2>)?

terse crown
modest grove
#

Yes the same error but I don't understand why this page doesn't work while others do.

#

password-change-form.component.ts

@Component({
    selector: 'password-change-form',
    templateUrl: './password-change-form.component.html',
    standalone: true,
    imports: [
        FormsModule,
        ReactiveFormsModule,
        PasswordCurrentComponent,
        PasswordNewComponent,
        CaptchaComponent,
        TranslateModule,
    ],
})
export class PasswordChangeFormComponent implements OnInit, OnDestroy {
    ....
}
#

When i remove PasswordCurrentComponent and PasswordNewComponent that work

#

But i use PasswordCurrentComponent in another component and that work

terse crown