Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 离子2-如何在index.html中使用事件绑定_Angular_Ionic Framework_Ionic2_Event Binding - Fatal编程技术网

Angular 离子2-如何在index.html中使用事件绑定

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

我想在index.html中使用事件绑定

我需要从数据库URL(Firebase)制作favicon和动态快捷方式图标

它看起来像这样:

<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
中使用它。