Angular 离子2-如何在index.html中使用事件绑定
我想在index.html中使用事件绑定 我需要从数据库URL(Firebase)制作favicon和动态快捷方式图标 它看起来像这样:Angular 离子2-如何在index.html中使用事件绑定,angular,ionic-framework,ionic2,event-binding,Angular,Ionic Framework,Ionic2,Event Binding,我想在index.html中使用事件绑定 我需要从数据库URL(Firebase)制作favicon和动态快捷方式图标 它看起来像这样: <link rel="icon" type= "image/x-icon" href="{{icon.url}}"> 但是我不知道如何在index.html文件中使用变量。 你能帮帮我吗?嘿,Matheus,你不能这么做(绑定),因为index.html不是Angular magic的一部分。如果您需要为图标等引入动态链接,最好使用@Serg
<link rel="icon" type= "image/x-icon" href="{{icon.url}}">
但是我不知道如何在index.html文件中使用变量。
你能帮帮我吗?嘿,Matheus,你不能这么做(绑定),因为index.html不是Angular magic的一部分。如果您需要为图标等引入动态链接,最好使用@SergeyRudenko提到的纯javascript(您也可以将其内联到index.html中),这是无法做到的。Angular的作用域从根标记开始,对于Ionic,它是
index.html
中的
标记。您不能在根标记之外使用Angular的功能,这意味着您不能在index.html
中使用它。