admin管理员组文章数量:1122846
Ref: /
I am trying to implement Arcgis with angular, everything is working fine map is displaying and layers are working until Item-Id is hardcoded (<arcgis-map item-id="sdfdfd43443433"...), but I want to assign "item-id" property dynamically, but it is not working correctly, not sure what am I missing here, here is the sample code
<arcgis-map [item-id]="itemId"></arcgis-map>
OR
<arcgis-map item-id="{{itemId}}"></arcgis-map>
@Component({
selector: 'app-my-map',
templateUrl: './my-mapponent.html',
styleUrls: ['./my-mapponent.css']
})
export class MyMapComponent implements OnInit {
itemId = 'YOUR_ITEM_ID'; // Replace with your actual item ID
ngOnInit() {
}
}
Ref: https://developers.arcgis.com/javascript/latest/get-started-angular/
I am trying to implement Arcgis with angular, everything is working fine map is displaying and layers are working until Item-Id is hardcoded (<arcgis-map item-id="sdfdfd43443433"...), but I want to assign "item-id" property dynamically, but it is not working correctly, not sure what am I missing here, here is the sample code
<arcgis-map [item-id]="itemId"></arcgis-map>
OR
<arcgis-map item-id="{{itemId}}"></arcgis-map>
@Component({
selector: 'app-my-map',
templateUrl: './my-map.component.html',
styleUrls: ['./my-map.component.css']
})
export class MyMapComponent implements OnInit {
itemId = 'YOUR_ITEM_ID'; // Replace with your actual item ID
ngOnInit() {
}
}
Share
Improve this question
edited Nov 23, 2024 at 16:09
Naren Murali
54.6k5 gold badges40 silver badges70 bronze badges
asked Nov 23, 2024 at 0:09
HariHari
393 bronze badges
1 Answer
Reset to default 1You can use the [attr.<<attribute name>>]="<<value>>"
syntax to dynamically bind the attribute value.
<arcgis-map [attr.item-id]="itemId"></arcgis-map>
本文标签: htmlAngular 17 with ArcGIS ItemidStack Overflow
版权声明:本文标题:html - Angular 17 with ArcGIS Item-id - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736300266a1930754.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论