本文整理汇总了TypeScript中app/core/ui-services/config.service.ConfigService.get方法的典型用法代码示例。如果您正苦于以下问题:TypeScript service.ConfigService.get方法的具体用法?TypeScript service.ConfigService.get怎么用?TypeScript service.ConfigService.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app/core/ui-services/config.service.ConfigService
的用法示例。
在下文中一共展示了service.ConfigService.get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
/**
* Constructs this component.
*
* @param {Title} titleService set the browser title
* @param {TranslateService} translate the translation service
* @param {ConfigService} configService The configuration provider
* @param {FormBuilder} formBuilder Form builder
* @param {MotionRepositoryService} repo Motion Repository
* @param {ActivatedRoute} route The activated route
* @param {Router} router The router
* @param {MatSnackBar} matSnackBar Material Design SnackBar
*/
public constructor(
titleService: Title,
protected translate: TranslateService, // protected required for ng-translate-extract
private configService: ConfigService,
private formBuilder: FormBuilder,
private repo: MotionRepositoryService,
private route: ActivatedRoute,
private router: Router,
matSnackBar: MatSnackBar
) {
super(titleService, translate, matSnackBar);
this.createForm();
this.configService.get<number>('motions_line_length').subscribe(lineLength => {
this.lineLength = lineLength;
this.getMotionByUrl();
});
this.configService.get<boolean>('motions_reason_required').subscribe(required => {
this.reasonRequired = required;
});
this.configService.get<boolean>('motions_amendments_multiple_paragraphs').subscribe(allowed => {
this.multipleParagraphsAllowed = allowed;
});
}
示例2: ngOnInit
/**
* Init the component.
*
* Sets the welcomeTitle and welcomeText.
*/
public ngOnInit(): void {
super.setTitle('Home');
// set the welcome title
this.configService
.get<string>('general_event_welcome_title')
.subscribe(welcomeTitle => (this.welcomeTitle = welcomeTitle));
// set the welcome text
this.configService
.get<string>('general_event_welcome_text')
.subscribe(welcomeText => (this.welcomeText = welcomeText as string));
}
示例3: constructor
public constructor(
private operator: OperatorService,
private configService: ConfigService,
private constants: ConstantsService
) {
// load config variables
this.configService
.get<number>('motions_min_supporters')
.subscribe(supporters => (this.configMinSupporters = supporters));
this.configService
.get<boolean>('motions_amendments_enabled')
.subscribe(enabled => (this.amendmentEnabled = enabled));
this.constants
.get<OpenSlidesSettings>('OpenSlidesSettings')
.subscribe(settings => (this.amendmentOfAmendment = settings.MOTIONS_ALLOW_AMENDMENTS_OF_AMENDMENTS));
}
示例4: constructor
public constructor(
titleService: Title,
translate: TranslateService,
matSnackBar: MatSnackBar,
private repo: CountdownRepositoryService,
private configService: ConfigService
) {
super(titleService, translate, matSnackBar);
this.configService.get<number>('agenda_countdown_warning_time').subscribe(time => (this.warningTime = time));
}
示例5: constructor
/**
* Constructor. Subscribes to configuration values
*
* @param translate handle translations
* @param motionRepo get parent motions
* @param configService Read config variables
* @param userRepo User repository for counting amount of ballots needed
* @param pdfService the pdf document creation service
*/
public constructor(
private translate: TranslateService,
private motionRepo: MotionRepositoryService,
private configService: ConfigService,
private userRepo: UserRepositoryService,
private pdfService: PdfDocumentService
) {
this.configService
.get<number>('motions_pdf_ballot_papers_number')
.subscribe(count => (this.ballotCustomCount = count));
this.configService
.get<BallotCountChoices>('motions_pdf_ballot_papers_selection')
.subscribe(selection => (this.ballotCountSelection = selection));
this.configService.get<string>('general_event_name').subscribe(name => (this.eventName = name));
this.configService.get<{ path?: string }>('logo_pdf_ballot_paper').subscribe(url => {
if (url && url.path) {
if (url.path.indexOf('/') === 0) {
url.path = url.path.substr(1); // remove prepending slash
}
this.logo = url.path;
}
});
}
示例6: ngOnInit
/**
* Gets the currently selected majority choice option from the repo
*/
public ngOnInit(): void {
this.majorityChoice =
this.pollService.majorityMethods.find(method => method.value === this.pollService.defaultMajorityMethod) ||
null;
this.descriptionForm = this.formBuilder.group({
description: this.poll ? this.poll.description : ''
});
this.subscriptions.push(
this.config.get<AssignmentPercentBase>('assignments_poll_100_percent_base').subscribe(() => {
if (this.poll) {
this.poll.pollBase = this.pollService.getBaseAmount(this.poll);
}
})
);
}
示例7: constructor
/**
* Constructs this component.
*
* @param {Title} titleService set the browser title
* @param {TranslateService} translate the translation service
* @param {ConfigService} configService The configuration provider
* @param {FormBuilder} formBuilder Form builder
* @param {MotionRepositoryService} repo Motion Repository
* @param {ActivatedRoute} route The activated route
* @param {Router} router The router
* @param {DomSanitizer} sanitizer The DOM Sanitizing library
* @param {LinenumberingService} lineNumbering The line numbering service
* @param {MatSnackBar} matSnackBar Material Design SnackBar
*/
public constructor(
titleService: Title,
protected translate: TranslateService, // protected required for ng-translate-extract
private configService: ConfigService,
private formBuilder: FormBuilder,
private repo: MotionRepositoryService,
private route: ActivatedRoute,
private router: Router,
private sanitizer: DomSanitizer,
private lineNumbering: LinenumberingService,
matSnackBar: MatSnackBar
) {
super(titleService, translate, matSnackBar);
this.createForm();
this.configService.get<number>('motions_line_length').subscribe(lineLength => {
this.lineLength = lineLength;
this.getMotionByUrl();
});
this.configService.get<boolean>('motions_reason_required').subscribe(required => {
this.reasonRequired = required;
});
}