AngularJS load different css files depending on locale -


i've got multilingual application supports farsi , english, might know farsi rtl, used css-flipper in gulp files create version of whole css files in rtl, problems cannot inject them (with gulp-inject, obvious reasons!) have manually insert them index.html best way this? use angular-css add css files depending on locale (i use angular-local) in it's constructor (i used typescript swiip's angular generator)

also, should able remove ltr css file , add rtl css file , vice versa

export class maincontroller {     private $translate: angular.translate.itranslateprovider;     private $css;      public constructor($translate: angular.translate.itranslateprovider, $css: object) {         this.$translate = $translate;         this.$css = $css;         if (this.getlang() === 'en') {         this.$css.add('app/index.min.css');         } else {             this.$css.add('app/index.rtl.min.css');         }     }      public getlang() {         return this.$translate.use();     }      public changelang() {         if (this.getlang() === 'fa') {             this.$translate.use('en');             this.$css.remove('app/index.rtl.min.css');             this.$css.add('app/index.min.css');         } else {             this.$translate.use('fa');             this.$css.remove('app/index.min.css');             this.$css.add('app/index.rtl.min.css');         }     } } 


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -