усилить angular signUpConfig, не обновляя поля
Следуя руководству по AWS Amplify для Angular, я попытался использовать signUpConfig, но у меня он не работает. Я видел соответствующий пост на их странице GitHub, в котором подразумевается, что переменная signUpConfig должна быть общедоступной, но для меня это тоже ничего не исправило.
Мой main.ts
:
import Amplify from 'aws-amplify';
import awsconfig from './aws-exports';
Amplify.configure(awsconfig);
app.module
:
import { AmplifyAngularModule, AmplifyService } from 'aws-amplify-angular';
...
imports: [
...
AmplifyAngularModule
],
providers: [
AmplifyService
]
И, наконец, мой компонент, в котором я использую signUpConfig
:
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-signup',
templateUrl: './signup.component.html',
styleUrls: ['./signup.component.css']
})
export class SignupComponent implements OnInit {
public signUpConfig = {
header: 'My Customized Sign Up',
hideAllDefaults: true,
defaultCountryCode: '1',
signUpFields: [
{
label: 'Email',
key: 'email',
required: true,
displayOrder: 1,
type: 'string',
},
{
label: 'Password',
key: 'password',
required: true,
displayOrder: 2,
type: 'password'
},
{
label: 'Phone Number',
key: 'phone_number',
required: true,
displayOrder: 3,
type: 'string'
},
{
label: 'Custom Attribute',
key: 'custom_attr',
required: false,
displayOrder: 4,
type: 'string',
custom: true
}
]
}
constructor() { }
ngOnInit() {
}
}
А вот и шаблон:
<amplify-authenticator [signUpConfig]="signUpConfig"></amplify-authenticator>