码迷,mamicode.com
首页 > 其他好文 > 详细

[Angular] Angular i18n Alternative Expressions Support (select)

时间:2019-02-12 00:17:19      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:sele   sel   example   express   amp   nbsp   begin   support   category   

For example we have those code:

    <div class="course-category" [ngSwitch]="course.category">

        <div class="category" *ngSwitchCase="‘BEGINNER‘">Beginner</div>

        <div class="category" *ngSwitchCase="‘INTERMEDIATE‘">Intermediate</div>

        <div class="category" *ngSwitchCase="‘ADVANCED‘">Advanced</div>

    </div>

 

ngSwith code, and we want to convert to i18n as well, we can use ‘select‘ keyword:

    <div class="category" i18n>

        {
            course.category,
            select,
            BEGINNER {Beginner}
            INTERMEDIATE {Intermediate}
            ADVANCED {Advanced}
        }

    </div>

 

[Angular] Angular i18n Alternative Expressions Support (select)

标签:sele   sel   example   express   amp   nbsp   begin   support   category   

原文地址:https://www.cnblogs.com/Answer1215/p/10363526.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!