草庐IT

angular2-highcharts

全部标签

javascript - Controller 内部的 Angular 1.6 绑定(bind)

我试图通过绑定(bind)将一些参数传递给我的组件,但不幸的是我没有在我的Controller中使用这些参数,这是我的代码:angular.module('project1').component('menu',{templateUrl:'/static/js/templates/menu.template.html',bindings:{rid:'@'},controller:['Restaurant',functionRestaurantListController(Restaurant){console.log(this.rid);console.log(this);this.r

javascript - Angular 2 ngFor 行和列创建了一个大 Col

显然ngfor会一个一个地生成div的划分,当它完成将所有div一个接一个地放置时,呈现出糟糕的设计,我想得到这样的东西:[1][2][3][4][5][6]结果就是:[1][2][3]andcontinues..我的JSON是这样的:[{"id_nivel":"1","nombre":"A","constelacion":"AA","descripcion":"AAAAAAAAAAAAAAAAAAAAA"},{"id_nivel":"2","nombre":"B","constelacion":"BB","descripcion":"BBBBBBBBBBBBBBBBBBBBB"},{

javascript - 未捕获的类型错误 : e. doDrilldown 不是函数 - Highcharts

我在我的React项目中使用了highcharts。我在我的模块中导入了highcharts。预期的行为是能够使用多个向下钻取实例。当向下钻取实际工作正常时,引发的异常e.doDrilldown不是函数。这发生在我的节点环境中,其中每个图都在自己的模块中,并且不知道其他图的存在。我尝试添加检查以查看是否已导入向下钻取。我尝试使用webpack来确保模块只加载一次。我目前在这样的一个文件中使用它importDrilldownfrom'highcharts/modules/drilldown';importHighchartsfrom'highcharts/highmaps.src.js'

javascript - 没有模型更改的 Angular 2 组件模型刷新 View

我有一个Angular2.4.0应用程序,我正在处理一个表单,该表单有一些支持Javascript验证/格式化几个字段。字段格式化完成后,如果格式化返回的值与附加到模型的原始值匹配,则View不会更新。有没有办法强制更新View?由于没有模型更改,因此强制组件刷新没有任何效果。我猜我需要用jQuery之类的东西单独更新View,但我想先检查是否有更好的解决方案。组件:导出类组件{字段:字符串formatField(updatedField:string){this.field=updatedField.replace(newRegexp("[^\\d]","g"),"");//remo

javascript - 如何在 Angular2 中为表单分配和验证数组

我在javascript中的模型(this.profile)有一个名为emails的属性,它是一个{email,isDefault,status}数组>然后我定义如下this.profileForm=this.formBuilder.group({....otherpropertieshereemails:[this.profile.emails]});console.log(this.profile.emails);//isanarrayconsole.log(this.profileForm.emails);//undefined在html文件中我用它作为{{emailInfo.e

javascript - 如何在 Highchart 中自定义工具提示?

我希望我的工具提示根据x轴显示时间范围。下图显示了我想要的。因此,如果有人知道我该怎么做,请告诉我或建议我。谢谢:)这是我的代码Highcharts.chart('container',{chart:{type:'areaspline'},title:{text:'Powerconsumption'},xAxis:{categories:['00:00','01:00','02:00','03:00','04:00','05:00','06:00','07:00','08:00','09:00','10:00','11:00','12:00','13:00','14:00','15:0

javascript - 如何在 angular2 typescript 中正确执行 "bind"?

我想使用一个javascript库,它需要像这样创建一个对象并绑定(bind)到它:this.mystr="hello";this.webkitspeech=newwebkitSpeechRecognition();this.webkitspeech.onresult=function(evt){console.log(this.mystr);//thisisundefined,eventhoughIdohaveitdefined}我通常会做一个.bind(this)虽然在typescript中我想这样做:this.mystr="hello"this.webkitspeech=neww

javascript - Angular2 错误 - 是否包含平台模块 (BrowserModule)?

我只是想在Angular2中运行一个简单的index.html页面,但它在控制台中向我显示zone.js中的错误:UnhandledPromiserejection:NoErrorHandler.Isplatformmodule(BrowserModule)included?;Zone:;Task:Promise.then;Value:Error:NoErrorHandler.Isplatformmodule(BrowserModule)included?ateval(application_ref.ts:364)atZoneDelegate.invoke(zone.js:391)at

javascript - 如何防止 Angular 4中的页面刷新

我想在任何地方都阻止页面刷新。我试过下面的代码import{Component,OnInit}from'@angular/core';import{Router}from'@angular/router';import{CommonServices}from'../services/common.service';@Component({selector:'app-review-prescription',templateUrl:'./review-prescription.component.html',styleUrls:['../../assets/css/prescriptio

javascript - 带有 es5 的 Angular 5

Angular4支持以下语法varHelloComponent=ng.coreComponent({selector:'hello-cmp',template:'HelloWorld!',viewProviders:[Service].Class({constructor:[Service,function(service){},`});在Angular5中,缺少类,目前任何人都可以为Angular5提供ES5语法我无法切换ES6,所以请避免使用该建议。如果切换到ES6是唯一的方法,那么我现在将坚持使用Angular4 最佳答案 您