MVC4缺少登录弹出窗口(MVC4 missing login popup)
嗨我刚刚将mvc4模板下载到我的VS2010中,我有常规的登录视图,而不是许多blogers描述的jquery popup,比如这里的链接
Hi i just downloaded mvc4 template into my VS2010 and i have regular view for login instead of jquery popup described by many blogers, like here for example link
原文:https://stackoverflow.com/questions/13781308
最满意答案
您可以通过以下方式更改指令,为当前数据添加新参数。 添加两个手表,您将确保每次从外部更改数据时,将刷新图表以设置正确的数据,并且在选项上第一个监视时,您将确保在实际加载选项时实例化图表:
.directive('mapChart', function(){ return { restrict: "E", replace: true, template: "<div id='map' class='div_content-holder'></div>", scope:{ options:"=", current: "=" // your actual data }, link: function(scope, element){ var chartexample = {}; scope.$watch('options', function() { chartexample = Highcharts.mapChart(element[0], scope.options); }); scope.$watch('current', function(){ chartexample.series[0].setData(scope.current); }); } } });
你可以摆脱两个观察者。 关于init,您必须确保在已经拥有所有选项后初始化您的指令,因此您不再需要关于选项的监视。 关于当前数据,您可以在指令中添加一个回调参数
&
,它将更新图表的值,并在与控制器内部选择的ngChange相关联的函数内调用该指令的回调。这将使代码更好,更清洁。 但是现在你可以这样享受你的图表:)
祝你的应用好运!
干杯:)
You can change your directive in the following way, adding a new parameter for the current data. Adding the two watches you will ensure that every time you change data from outside, the chart will be refreshed setting up the correct data and with the first watch on the option you will ensure to instantiate the chart when your options have really been loaded:
.directive('mapChart', function(){ return { restrict: "E", replace: true, template: "<div id='map' class='div_content-holder'></div>", scope:{ options:"=", current: "=" // your actual data }, link: function(scope, element){ var chartexample = {}; scope.$watch('options', function() { chartexample = Highcharts.mapChart(element[0], scope.options); }); scope.$watch('current', function(){ chartexample.series[0].setData(scope.current); }); } } });
You can get rid of both the watchers. About the init, you just have to be sure to init your directive once you have already all your options, so you don't need anymore the watch on the options. About the current data, you can add a callback parameter
&
in the directive which will update the values of the chart, and call this callback of the directive inside the function associated to the ngChange of the select inside the controller.This will make the code better and cleaner. But for now you can enjoy your chart in this way :)
My best luck for your app!
Cheers :)
相关问答
更多-
这是因为当您在指令中定义范围对象时,它会为该指令创建一个隔离范围。 这意味着,指令中的范围无法访问外部定义的范围属性。 您在附加函数updateChart的外部作用域上定义了控制器。 因此,您的isolate scope指令不了解此方法。 要解决此问题,您可以在指令本身上定义控制器。 在该控制器中,定义方法updateChart .directive('changeChart', function() { return { restrict: 'E', scope: { ...
-
寻找具有GPS坐标的世界地图的Highmaps示例(Looking for a Highmaps example of worldmap with GPS coordinates)[2023-12-02]
你需要在Highmaps之前加载proj4js,例如从cdnjs加载 : 然后在创建你的系列时,给每个点一个lat和一个lon ,如下所示: series: [{ data: [{ name: 'London', lat: 51.507222, lon: -0.1275 ... -
确实是的。 mapdata实际上是Highcharts的官方地图集。 如官方文档中所述: http : //www.highcharts.com/docs/maps/map-collection 您可以通过包含Highcharts服务器上托管的文件,使用script标签,AMD或任何其他模块加载方式简单地加载地图,例如: 集合中的所有地图也以geojson格 ...
-
错误: highcharts.Map未定义 发生,因为你包括modules/maps.js但无法找到此文件。 您要包含的模块名为map.js 该文件位于/packages/highcharts-container/.npm/package/node_modules/highcharts/modules/目录中。 如果要在Meteor中实现Highcharts Maps演示 ,请执行以下七个步骤: 运行命令meteor add highcharts:highcharts-meteor 。 运行meteor以初 ...
-
错误被打印出来,因为你错过了highcharts-more.js文件。 添加对此文件的引用,示例将起作用。 http://jsfiddle.net/hkjbn6wg/2/ The error is printed, because you miss highcharts-more.js file. Add the reference to this file and ...
-
绑定到highcharts / highmaps指令时,数组设置为null(Array sets to null when bound to highcharts/highmaps directive)[2022-09-07]
您可以通过以下方式更改指令,为当前数据添加新参数。 添加两个手表,您将确保每次从外部更改数据时,将刷新图表以设置正确的数据,并且在选项上第一个监视时,您将确保在实际加载选项时实例化图表: .directive('mapChart', function(){ return { restrict: "E", replace: true, template: "", ... -
如何处理AngularJS指令中的Highcharts事件?(How to handle Highcharts events from an AngularJS directive?)[2023-05-01]
如果你直接使用作用域中的数据,它似乎是有效的,所以它是从属性中进行JSON解析的东西。 也许该函数试图以某种方式得到评估? 在使用图表数据检查属性字符串后,您可以看到事件:function包含空白对象。 plunker: http ://plnkr.co/edit/QyccE0NDRfUCTuxTftUV?p = preview It seems to be working if you use the data from the scope directly so it's something with ... -
您的JSON中的value属性未设置。 由于您更改了格式,因此您的工具提示可以正常工作,但您没有为点设置任何值(以Highcharts的形式)。 尝试这个: data: data.map(function(el) { el.value = el.TotalSales; return el; }); value property in your JSON is not set. Your tooltip works, because you changed it's format, but yo ...
-
如果您还需要连接空值,请使用connectNull:true plotOptions: { series: { connectNulls: true } } 这里更新了小提琴 If you need to connect null values as well use connectNull:true plotOptions: { series: { connectNulls: true ...
-
感谢所有的投入。 我最终采用了不同的方法。 我没有包装渲染本身,而是包装了colorAxis的颜色计算。 像这样的东西: Highcharts.wrap(Highcharts.ColorAxis.prototype, 'toColor', function (proceed, value, point) { var color = proceed.call(this, value, point); if(point.isSpecial) { color = color.re ...