angularjs 相关问题

用于关于开源JavaScript框架AngularJS(1.x)的问题。不要将此标记用于Angular 2或更高版本;相反,使用[angular]标签。

平静的 POST 响应的“最佳”实践

所以这里没有什么新内容,我只是想得到一些澄清,似乎在其他帖子中找不到任何澄清。 我正在平静地创建一个新资源,说: /书籍(邮寄) 与身体: { 标题:'...

回答 4 投票 0

有人知道免费网站托管网站吗

我正在寻找有关免费托管平台的信息,我可以在其中部署我的 Angular 项目。目的是在实时环境中验证我开发的网站的功能。我有能力...

回答 1 投票 0

从/到单位转换避免大型 if/switch 语句

我有一个 if/else 代码块,它返回从/到某个公制单位转换所需的数字,例如,如果我想从厘米转换为毫米,它将返回 100。 这是实际的合作...

回答 2 投票 0

处理 Angular 中页面的多个实例 + 一些其他内容

我正在使用 AngularJS 构建一个新应用程序,下文是对其的简化描述。 有一个页面,其中有药丸和选项卡(使用 Bootstrap)以及侧窗格...

回答 2 投票 0

Angular 中如何实现国际化?

如何在 Angular 中实现国际化,特别是货币符号?我想根据本地化加载货币。 我在登录页面有类似这样的内容: 英语-英国

回答 1 投票 0

AngularJS - 初始化日期输入

我有一个应用程序,其中有几个日期字段需要接受来自用户和数据库的值。 我找到了这个解决方案,但仍然收到错误消息 错误:[ng...

回答 1 投票 0

根据窗口大小调整 Highchart 的大小

嗨,我有左侧导航菜单,右侧内容是高图表。 以下是我的 Highchart 配置, 这.InputData = { 图表:{类型:'列'}, 标题:{t...

回答 2 投票 0

如何在 Angular 17 中显示从一个组件中的 api 到另一组件的响应

这是我的服务代码: 从 '@angular/core' 导入 { Injectable } ; 从'rxjs'导入{BehaviorSubject}; @Injectable({ 提供于:'root' }) 导出类 ResponseService { 私人

回答 1 投票 0

Angular17 应用程序中的引导程序使用

如何从 CLI 在 Angular-17 应用程序中添加引导程序 我尝试使用 npm install -g bootstrap 全局安装 bootstrap 然后在 angular.json 中的样式和脚本中添加所需的行。 &...

回答 1 投票 0

Angular 12 构建警告:主题类

将我的 Angular 应用程序升级到版本 12 时,我在构建过程中收到有关用于切换主题的 .isDarkTheme 类的警告。 在此输入图像描述 是什么导致了这个警告...

回答 1 投票 0

检索“b5x-stateful-inline-icon”标志出错:超时 - 回退

我的小型 Angular 项目收到此错误消息。你知道如何解决吗? 错误消息的屏幕截图 我检查了我的代码,但没有找到解决方案。我希望看到

回答 1 投票 0

如何等待turnstile.execute完成?

我正在尝试使用此处记录的 Cloudflare 旋转门和执行选项。我在按下按钮后调用的异步函数中调用turnstile.execute,但该函数似乎不...

回答 1 投票 0

使用 AngularJS 的 $http.get() 处理 64 位数字

在我的 Angular 应用程序中,我正在向使用 json 对象响应的 URL 发出 $http.get() 请求。该对象包含一个偶尔非常大的值(例如 9106524608436223400)。

回答 2 投票 0

更新 slickgrid 中列标题的内容

我在支持多种语言的角度应用程序中使用 slickgrid。当所选语言更改时,如何更新列标题。 我的列定义如下所示......

回答 2 投票 0

Angularjs,如何将oracle时间戳(6)格式化为字符串而不丢失最后3位数字?

AngularJS 有一个日期过滤器,但似乎精度只能低至毫秒。 https://docs.angularjs.org/api/ng/filter/date 所以对于 oracle 时间戳(6),其精度低至小数点后六位...

回答 1 投票 0

如何以正确的方式在组件中获取角度/谷歌地图参考

我使用@angular/google-maps”:“^17.3.5”和角度“^17.3.5” 我尝试获取我的谷歌地图的参考 我使用 @angular/google-maps": "^17.3.5" 和 Angular "^17.3.5" 我尝试获取我的谷歌地图的参考 <google-map #map mapId="map" height="100%" width="100%" [options]="options"</google-map> 来自我的组件。然而,@ViewChild(GoogleMap) map!: GoogleMap;似乎不起作用。当我尝试在ngAfterViewInit()中使用它时: ngAfterViewInit(): void { this.map.googleMap!.fitBounds({ north: 43.516034, south: 43.423021, east: 5.471529, west: 5.456153, }); } 我得到: ERROR TypeError: Cannot read properties of undefined (reading 'googleMap') 使用 mapInitialized 似乎有效,但是,然后我只得到 google.map.Map 而不是 GoogleMap。我不确定这在某种程度上是否是一个缺点。 <google-map #map (mapInitialized)="initMap($event)" mapId="map" height="100%" width="100%" [options]="options"></google-map>` 组件: map!: google.maps.Map initMap(map: google.maps.Map) { this.map = map; this.initAdvancedMarkers() } async initAdvancedMarkers() { const {AdvancedMarkerElement} = await google.maps.importLibrary("marker") as google.maps.MarkerLibrary; let markers = [ { lat: 43.516034, lng: 5.471529, }, { lat: 43.523021, lng: 5.456153, }, { lat: 43.423021, lng: 5.456153, }, ]; let bounds = new google.maps.LatLngBounds(); // Set markers and fit bounds to show all markers markers.forEach((marker: any) => { new AdvancedMarkerElement({ map: this.map, position: marker }); bounds.extend( new google.maps.LatLng(marker.lat, marker.lng) ); }); this.map.fitBounds(bounds); } 我找不到使用当前版本的谷歌地图执行此操作的正确示例,因此任何正确方向的提示将不胜感激。 问题不可重现,请确保 @if 或 *ngIf 中没有 google 地图元素,这可能会阻止您访问它! 否则您可以尝试切换静态标志并检查它是否解决您的问题! @ViewChild(GoogleMap, { static: true }) map!: GoogleMap; // or @ViewChild(GoogleMap, { static: false }) map!: GoogleMap; 工作 stackblitz,其中视图子项正常出现,如下! 完整代码: import { Component, ViewChild } from '@angular/core'; import { bootstrapApplication } from '@angular/platform-browser'; import { GoogleMap } from '@angular/google-maps'; import 'zone.js'; @Component({ selector: 'app-root', standalone: true, imports: [GoogleMap], template: ` <!-- google-maps-demo.component.html --> <google-map height="400px" width="750px" [center]="center" [zoom]="zoom" (mapClick)="moveMap($event)" (mapMousemove)="move($event)" /> <div>Latitude: {{display?.lat}}</div> <div>Longitude: {{display?.lng}}</div> `, }) export class App { @ViewChild(GoogleMap, { static: true }) map!: GoogleMap; center: google.maps.LatLngLiteral = { lat: 24, lng: 12 }; zoom = 4; display!: google.maps.LatLngLiteral | undefined; ngAfterViewInit(): void { console.log(this.map); this.map.googleMap!.fitBounds({ north: 43.516034, south: 43.423021, east: 5.471529, west: 5.456153, }); } moveMap(event: google.maps.MapMouseEvent) { this.center = <google.maps.LatLngLiteral>event.latLng?.toJSON(); } move(event: google.maps.MapMouseEvent) { this.display = event.latLng?.toJSON(); } } bootstrapApplication(App); Stackblitz 演示

回答 1 投票 0

使用 FormArray 在 Angular 中添加排序

Angular 新手。我有一个输入类 Foo,其中有一个书籍列表,其中 Book 类具有 Id、Title 和 Description 属性。我将其显示在带有输入的表格中,以便用户可以添加、编辑或删除...

回答 1 投票 0

我们可以使用扩展运算符来合并数组吗? [已关闭]

将两个变量 a 和 b 作为两个不同的数组,变量 c 仅在一个数组中显示输出,这意味着该方法将两个或多个数组合并为一个数组 让a=[a,b]; 让...

回答 3 投票 0

AngularJS,根据另一个数组当前位置显示数组值

在javascript中,有两个数组,它们的长度相等,但长度是未知的,基于一些db值。例如 colName=['col1','col2','col3']; fieldValue=['abc','def','ghi']; 或者 上校...

回答 1 投票 0

Tinymce 指令后 AngularJS 导航不起作用

我有问题我无法弄清楚,但我确实有提示。在集成 TinyMCE 之前,主导航工作正常,例如链接“设置”、“分析”、“设置”;如果您单击它们,它现在不起作用。 ...

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.