Nativescript angular will it support external storage css file


#1

Hi,
In my app i am using dynamic css file, so i download css file from server and put into internal storage, can i use that css file for my component, is it possible?, i tried it’s not working, this is my internal storage css path: “file:///storage/sdcard/Android/data/com.sify.livewire/files/downloads/UNFPA/test.css”,

ex:

@Component({
    selector: "login",
    moduleId: module.id,
    templateUrl: "./login.component.html",
    styleUrls: ['file:///storage/sdcard/Android/data/com.sify.livewire/files/downloads/UNFPA/test.css'],
})

#2
  • Did you try setting the encapsulation to None?
  • Try directly pointing to the remote url instead of writing it to your app storage then pointing it. It’s not guaranteed that path will be same in all device variants.

#3

i changed my code like this, but it’s not working

@Component({
    selector: "login",
    moduleId: module.id,
    templateUrl: "./login.component.html",
    styleUrls: ['file:///storage/sdcard/Android/data/com.sify.livewire/files/downloads/UNFPA/test.css'],
    encapsulation: ViewEncapsulation.None
})