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


TypeScript MatIconRegistry.addSvgIcon方法代碼示例

本文整理匯總了TypeScript中@angular/material.MatIconRegistry.addSvgIcon方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript MatIconRegistry.addSvgIcon方法的具體用法?TypeScript MatIconRegistry.addSvgIcon怎麽用?TypeScript MatIconRegistry.addSvgIcon使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@angular/material.MatIconRegistry的用法示例。


在下文中一共展示了MatIconRegistry.addSvgIcon方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: init

 public init() {
   this.iconRegistry.addSvgIcon(
       'add',
       this.sanitizer.bypassSecurityTrustResourceUrl('assets/icons/note_add_48px.svg'));
   this.iconRegistry.addSvgIcon(
       'edit',
       this.sanitizer.bypassSecurityTrustResourceUrl('assets/icons/edit_48px.svg'));
   this.iconRegistry.addSvgIcon(
       'delete',
       this.sanitizer.bypassSecurityTrustResourceUrl('assets/icons/delete_forever_48px.svg'));
   this.iconRegistry.addSvgIcon(
       'calendar',
       this.sanitizer.bypassSecurityTrustResourceUrl('assets/icons/calendar.svg'));
   this.iconRegistry.addSvgIcon(
       'time',
       this.sanitizer.bypassSecurityTrustResourceUrl('assets/icons/time.svg'));
   this.iconRegistry.addSvgIcon(
       'search',
       this.sanitizer.bypassSecurityTrustResourceUrl('assets/icons/search.svg'));
   this.iconRegistry.addSvgIcon(
       'title',
       this.sanitizer.bypassSecurityTrustResourceUrl('assets/icons/title.svg'));
   this.iconRegistry.addSvgIcon(
       'logout',
       this.sanitizer.bypassSecurityTrustResourceUrl('assets/icons/logout.svg'));
   this.iconRegistry.addSvgIcon(
       'arrow_down',
       this.sanitizer.bypassSecurityTrustResourceUrl('assets/icons/arrow_down.svg'));
   this.iconRegistry.addSvgIcon(
       'user',
       this.sanitizer.bypassSecurityTrustResourceUrl('assets/icons/user.svg'));
 }
開發者ID:KavvaP17,項目名稱:Angular_Global_Mentoring_Program_2018_Task2,代碼行數:32,代碼來源:init-icons.service.ts

示例2: constructor

 constructor(
   private matIconRegistry: MatIconRegistry,
   private sanitizer: DomSanitizer,
   private appModeActions: AppModeActions
 ) {
    matIconRegistry.addSvgIcon('logo', sanitizer.bypassSecurityTrustResourceUrl('assets/img/logo.svg'));
 }
開發者ID:christinakayastha,項目名稱:parkabler,代碼行數:7,代碼來源:header.component.ts

示例3: constructor

 constructor(iconRegistry: MatIconRegistry, sanitizer: DomSanitizer) {
   iconRegistry
       .addSvgIcon('thumb-up',
           sanitizer.bypassSecurityTrustResourceUrl('/icon/assets/thumbup-icon.svg'))
       .addSvgIconSetInNamespace('core',
           sanitizer.bypassSecurityTrustResourceUrl('/icon/assets/core-icon-set.svg'))
       .registerFontClassAlias('fontawesome', 'fa');
 }
開發者ID:ravichandra480,項目名稱:material2,代碼行數:8,代碼來源:icon-demo.ts

示例4: constructor

  constructor(iconRegistry: MatIconRegistry, sanitizer: DomSanitizer) {
    iconRegistry.addSvgIcon(
      'linkedin',
      sanitizer.bypassSecurityTrustResourceUrl('./linkedin.svg'));

    iconRegistry.addSvgIcon(
      'twitter',
      sanitizer.bypassSecurityTrustResourceUrl('./twitter.svg'));

    iconRegistry.addSvgIcon(
      'facebook',
      sanitizer.bypassSecurityTrustResourceUrl('./facebook.svg'));

    iconRegistry.addSvgIcon(
      'instagram',
      sanitizer.bypassSecurityTrustResourceUrl('./instagram.svg'));

  }
開發者ID:intermadix,項目名稱:XBMS-webapp,代碼行數:18,代碼來源:icon.service.ts

示例5: registerIcons

    registerIcons(icons :string[]) {

        for (let icon of icons) {

            this.iconRegistry.addSvgIcon(
                icon, 
                this.sanitizer.bypassSecurityTrustResourceUrl(`assets/${icon}.svg`));
        }
    }
開發者ID:grecosoft,項目名稱:Sandbox,代碼行數:9,代碼來源:material.module.ts

示例6: constructor

    constructor(iconRegistry: MatIconRegistry, sanitizer: DomSanitizer) {  

        iconRegistry.addSvgIcon('hal-viewer', sanitizer.bypassSecurityTrustResourceUrl('app/areas/HalViewer/assets/img/ic_beenhere_white_24px.svg'));
        iconRegistry.addSvgIcon('nav-notifications', sanitizer.bypassSecurityTrustResourceUrl('app/areas/HalViewer/assets/img/ic_alarm_white_24px.svg'));   
        iconRegistry.addSvgIcon('nav-settings', sanitizer.bypassSecurityTrustResourceUrl('app/areas/HalViewer/assets/img/ic_settings_white_24px.svg'));   
        iconRegistry.addSvgIcon('nav-connections', sanitizer.bypassSecurityTrustResourceUrl('app/areas/HalViewer/assets/img/ic_location_on_white_24px.svg')); 
        iconRegistry.addSvgIcon('nav-environments', sanitizer.bypassSecurityTrustResourceUrl('app/areas/HalViewer/assets/img/ic_language_white_24px.svg'));   
        iconRegistry.addSvgIcon('nav-entries', sanitizer.bypassSecurityTrustResourceUrl('app/areas/HalViewer/assets/img/ic_image_aspect_ratio_white_24px.svg'));   
        iconRegistry.addSvgIcon('nav-resources', sanitizer.bypassSecurityTrustResourceUrl('app/areas/HalViewer/assets/img/ic_group_work_white_24px.svg'));  
        iconRegistry.addSvgIcon('view-properties', sanitizer.bypassSecurityTrustResourceUrl('app/areas/HalViewer/assets/img/ic_list_white_24px.svg'));
    }
開發者ID:grecosoft,項目名稱:NetFusion,代碼行數:11,代碼來源:area.module.ts

示例7: constructor

 constructor(domSanitizer: DomSanitizer, matIconRegistry: MatIconRegistry) {
   matIconRegistry.addSvgIcon("warning", domSanitizer.bypassSecurityTrustResourceUrl("../assets/icons/alert/baseline-warning-24px.svg"));
   matIconRegistry.addSvgIcon("info", domSanitizer.bypassSecurityTrustResourceUrl("../assets/icons/action/baseline-info-24px.svg"));
   matIconRegistry.addSvgIcon("flag", domSanitizer.bypassSecurityTrustResourceUrl("../assets/icons/content/baseline-flag-24px.svg"));
   matIconRegistry.addSvgIcon("outlined_flag", domSanitizer.bypassSecurityTrustResourceUrl("../assets/icons/content/baseline-outlined_flag-24px.svg"));
   matIconRegistry.addSvgIcon("ok", domSanitizer.bypassSecurityTrustResourceUrl("../assets/icons/action/baseline-check_circle-24px.svg"));
   matIconRegistry.addSvgIcon("cancel", domSanitizer.bypassSecurityTrustResourceUrl("../assets/icons/navigation/baseline-cancel-24px.svg"));
   matIconRegistry.addSvgIcon("menu", domSanitizer.bypassSecurityTrustResourceUrl("../assets/icons/navigation/baseline-menu-24px.svg"));
 }
開發者ID:GamesByEmail,項目名稱:Games-Chess,代碼行數:9,代碼來源:app.module.ts

示例8: constructor

 constructor(
   iconRegistry: MatIconRegistry,
   sanitizer: DomSanitizer,
   public authService: AuthService,
   public media: ObservableMedia
 ) {
   iconRegistry.addSvgIcon(
     'lemon',
     sanitizer.bypassSecurityTrustResourceUrl('assets/img/icons/lemon.svg')
   )
 }
開發者ID:ershad1,項目名稱:lemon-mart-1,代碼行數:11,代碼來源:app.component.ts

示例9: constructor

 constructor(iconRegistry: MatIconRegistry, sanitizer: DomSanitizer) {
   iconRegistry
       .addSvgIcon('thumb-up',
           sanitizer.bypassSecurityTrustResourceUrl('/icon/assets/thumbup-icon.svg'))
       .addSvgIconLiteral('bike',
           sanitizer.bypassSecurityTrustHtml(BIKE_ICON))
       .addSvgIconSetInNamespace('core',
           sanitizer.bypassSecurityTrustResourceUrl('/icon/assets/core-icon-set.svg'))
       .addSvgIconSetLiteralInNamespace('core-inline',
           sanitizer.bypassSecurityTrustHtml(INLINE_ICON_SET))
       .registerFontClassAlias('fontawesome', 'fa');
 }
開發者ID:Nodarii,項目名稱:material2,代碼行數:12,代碼來源:icon-demo.ts

示例10: constructor

 constructor(matIconRegistry: MatIconRegistry, private readonly sanitizer: DomSanitizer) {
   matIconRegistry
     // Logo.
     .addSvgIcon('shapeshifter', this.trustUrl('assets/shapeshifter.svg'))
     // Icons.
     .addSvgIcon('addlayer', this.trustUrl('assets/icons/addlayer.svg'))
     .addSvgIcon('autofix', this.trustUrl('assets/icons/autofix.svg'))
     .addSvgIcon('contribute', this.trustUrl('assets/icons/contribute.svg'))
     .addSvgIcon('reverse', this.trustUrl('assets/icons/reverse.svg'))
     .addSvgIcon('animation', this.trustUrl('assets/icons/animation.svg'))
     .addSvgIcon('collection', this.trustUrl('assets/icons/collection.svg'))
     .addSvgIcon('animationblock', this.trustUrl('assets/icons/animationblock.svg'))
     .addSvgIcon('mask', this.trustUrl('assets/icons/clippathlayer.svg'))
     .addSvgIcon('group', this.trustUrl('assets/icons/grouplayer.svg'))
     .addSvgIcon('path', this.trustUrl('assets/icons/pathlayer.svg'))
     .addSvgIcon('vector', this.trustUrl('assets/icons/vectorlayer.svg'));
 }
開發者ID:arpitsaan,項目名稱:ShapeShifter,代碼行數:17,代碼來源:app.module.ts


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