我正在尝试使用基于范围值的differtent模板制作指令.
这是我到目前为止所做的,我不知道为什么不起作用http://jsbin.com/mibeyotu/1/edit
HTML元素:
<data-type content-attr="test1"></data-type>
Run Code Online (Sandbox Code Playgroud)
指示:
var app = angular.module('myApp', []);
app.directive('dataType', function ($compile) {
var testTemplate1 = '<h1>Test1</h1>';
var testTemplate2 = '<h1>Test2</h1>';
var testTemplate3 = '<h1>Test3</h1>';
var getTemplate = function(contentType){
var template = '';
switch(contentType){
case 'test1':
template = testTemplate1;
break;
case 'test2':
template = testTemplate2;
break;
case 'test3':
template = testTemplate3;
break;
}
return template;
};
var linker = function(scope, element, attrs){
element.html(getTemplate(scope.content)).show();
$compile(element.contents())(scope);
};
return {
restrict: "E",
replace: true,
link: linker,
scope: {
content:'='
} …
Run Code Online (Sandbox Code Playgroud) 我仍然在与AngularJS合作开发其他库,因为它与其他库有不同的逻辑.我需要使用amCharts Stock可视化数据,但是互联网上没有任何关于这两个人在一起的事情.
我如何使用angularjs来完成这项工作:http://jsfiddle.net/922JW/
var chart = AmCharts.makeChart("chartdiv", {
type: "stock",
"theme": "none",
pathToImages: "http://www.amcharts.com/lib/3/images/",
categoryAxesSettings: {
minPeriod: "mm"
},
dataSets: [{
color: "#b0de09",
fieldMappings: [{
fromField: "value",
toField: "value"
}, {
fromField: "volume",
toField: "volume"
}],
dataProvider: chartData,
categoryField: "date"
}],
panels: [{
showCategoryAxis: false,
title: "Value",
percentHeight: 70,
stockGraphs: [{
id: "g1",
valueField: "value",
type: "smoothedLine",
lineThickness: 2,
bullet: "round"
}],
stockLegend: {
valueTextRegular: " ",
markerType: "none"
}
},
{
title: "Volume",
percentHeight: 30,
stockGraphs: …
Run Code Online (Sandbox Code Playgroud) 是否可以在重新打开应用程序后调用函数(使用主页按钮关闭,而不是作为进程关闭)?
如何(d-m-Y H:i)
使用all()
方法从数据库返回时间戳转换为日期的所有行?
它不是created_at
或updated_at
列,它的自定义属性,birthday
如果你愿意,可以调用它.
我有一个目录,其中.jpg
包含以UNIX时间戳格式命名的图像。如何将所有从最早的时间戳开始的图像转换为最新的.mp4
视频格式?
我发现了一个解决方案,但它使用的增量命名,如image001
,image002
。
我将不胜感激任何帮助。谢谢。
使用aergistal的解决方案时,我在输出中出现错误:我按照您说的做,但是出现了输出错误:
Input #0, concat, from 'list.txt':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 540x405 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
[swscaler @ 0x14751c0] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0x14b7120] height not divisible by 2 (540x405)
Output #0, mp4, to 'out.mp4':
Stream #0:0: Video: h264, none, q=2-31, 128 kb/s, SAR 1:1 …
Run Code Online (Sandbox Code Playgroud)