當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript service.ConfigService.get方法代碼示例

本文整理匯總了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;
        });
    }
開發者ID:CatoTH,項目名稱:OpenSlides,代碼行數:38,代碼來源:amendment-create-wizard.component.ts

示例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));
    }
開發者ID:CatoTH,項目名稱:OpenSlides,代碼行數:18,代碼來源:start.component.ts

示例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));
 }
開發者ID:jwinzer,項目名稱:OpenSlides,代碼行數:16,代碼來源:local-permissions.service.ts

示例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));
    }
開發者ID:emanuelschuetze,項目名稱:OpenSlides,代碼行數:11,代碼來源:countdown-controls.component.ts

示例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;
         }
     });
 }
開發者ID:CatoTH,項目名稱:OpenSlides,代碼行數:32,代碼來源:motion-poll-pdf.service.ts

示例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);
             }
         })
     );
 }
開發者ID:CatoTH,項目名稱:OpenSlides,代碼行數:18,代碼來源:assignment-poll.component.ts

示例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;
        });
    }
開發者ID:emanuelschuetze,項目名稱:OpenSlides,代碼行數:38,代碼來源:amendment-create-wizard.component.ts


注:本文中的app/core/ui-services/config.service.ConfigService.get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。