我可以将转换后的image.svg用作谷歌地图图标.我正在将我的png图像转换为svg,我想使用这个像可以旋转的谷歌地图符号.我已经尝试使用谷歌地图符号但我希望有一个像汽车,男人等图标...这就是为什么我将我的一些png文件转换为svg,就像这个示例网站他用于这些http:/ /www.goprotravelling.com/
我有一个使用$ resource的简单控制器:
var Regions = $resource('mocks/regions.json');
$scope.regions = Regions.query();
Run Code Online (Sandbox Code Playgroud)
我在指令中使用这个控制器(在链接函数中)
var regions = scope.regions;
Run Code Online (Sandbox Code Playgroud)
但是地区是不确定的.调用是异步的,这是相当逻辑的.
我的问题是如何才能等待结果和区域成为包含所有数据的数组?
UPDATE :
Run Code Online (Sandbox Code Playgroud)
这里是指令的定义
app.directive('ngMap', function() {
return {
restrict: 'EA',
replace: 'true',
scope: {
},
template: '<div id="map"></div>',
controller: 'AccordMapCtrl',
link: function(scope, element, attrs) {
var regions = scope.regions;
console.log(regions);
for (var region in regions) {}
};
});
Run Code Online (Sandbox Code Playgroud) 我有以下错误
模块c的元数据版本不匹配:/..../node_modules/angularfire2/index.d.ts,找到版本4,预期3.
如果我去查看我的package.json,我在版本5.0.0-rc.4上有angularfire2,在4.6.2上有firebase. 详情见屏幕截图
我尝试将angularfire2和firebase的版本更改为以前的版本,但没有任何效果.
有什么建议 ?谢谢.
{
"name": "twitter-revamped",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^4.2.4",
"@angular/common": "^4.2.4",
"@angular/compiler": "^4.2.4",
"@angular/core": "^4.2.4",
"@angular/forms": "^4.2.4",
"@angular/http": "^4.2.4",
"@angular/platform-browser": "^4.2.4",
"@angular/platform-browser-dynamic": "^4.2.4",
"@angular/router": "^4.2.4",
"angularfire2": "^5.0.0-rc.4",
"core-js": "^2.4.1",
"firebase": "^4.6.2",
"ng2-semantic-ui": "^0.9.6",
"rxjs": "<5.4.2",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "1.4.7",
"@angular/compiler-cli": "^4.2.4",
"@angular/language-service": "^4.2.4",
"@types/jasmine": …Run Code Online (Sandbox Code Playgroud) 我正在使用选择2下拉列表,然后在其内容中显示一些长句.我想在正确的位置为句子添加换行符,但下拉菜单是自动调整.
这条线现在看起来像这样
选择2期100美元.(特别
提供.)
我需要添加受控换行符,使其看起来像这样:
选择2期100美元.
(特价.)
我不想增加下拉列表的宽度或改变字体大小.
我的代码在jsfiddle:
<select multiple id="e1" style="width:300px">
<option value="1">select 1 installment of $200</option>
<option value="2">select 2 installments of $100. (special offer.)</option>
<option value="3">select 3 installments of $89</option>
<option value="4">select 4 installments of $50. (no interest in this option)</option>
<option value="5">select 5 installments of $45</option>
</select>
Run Code Online (Sandbox Code Playgroud) 当我尝试获得这种类型的锯齿形时,我遇到了问题,我尝试了很多,但不幸的是它不起作用。
我尝试了这种编码方式
CSS
.zigzag:before {
content: "";
display: block;
position: absolute;
top: -10px;
width: 100%;
height: 10px;
}
.container2:before {
background:
linear-gradient(
45deg, transparent 33.333%,
#E2E2E2 33.333%, #E2E2E2 66.667%,
transparent 66.667%
),
linear-gradient(
-45deg, transparent 33.333%,
#E2E2E2 33.333%, #E2E2E2 66.667%,
transparent 66.667%
);
background-size: 20px 40px;
}
Run Code Online (Sandbox Code Playgroud)
但我喜欢锯齿形矩形,但我需要的是直线而不是矩形
是否可以使用CSS来实现与以下在JavaScript中完成的示例相同的输出.我想只在CSS中执行此操作.
HTML
<div class="first-div" id="black"></div>
<div class="second-div" id="blue" ></div>
<div class="third-div" id="green"></div>
<div class="forth-div" id="yellow"></div>
<br>
<input type="radio" value="Black" name="clr" onClick="f(this.value)">Black
<input type="radio" value="Blue" name="clr" onClick="f(this.value)" >Blue
<input type="radio"value="Green" name="clr" onClick="f(this.value)" >Green
<input type="radio"value="Yellow" name="clr" onClick="f(this.value)">Yellow
Run Code Online (Sandbox Code Playgroud)
CSS
div{
position:absolute;
background-color:red;
height:150px;
width:150px;
margin:10px;
}
.first-div{background-color:black;}
.second-div{background-color:blue;}
.third-div{background-color:green;}
.forth-div{background-color:yellow;}
Run Code Online (Sandbox Code Playgroud)
JavaScript 我想在没有JavaScript代码的情况下执行相同的功能.只是应用CSS,黑客单选按钮强制它改变点击div的颜色
function f(IncValue)
{
if(IncValue=="Black")
{
document.getElementById('black').style.visibility="visible";
document.getElementById('blue').style.visibility="hidden";
document.getElementById('green').style.visibility="hidden";
document.getElementById('yellow').style.visibility="hidden";
}
else if(IncValue=="Blue")
{
document.getElementById('blue').style.visibility="visible";
document.getElementById('black').style.visibility="hidden";
document.getElementById('green').style.visibility="hidden";
document.getElementById('yellow').style.visibility="hidden";
}
else if(IncValue=="Green")
{
document.getElementById('green').style.visibility="visible";
document.getElementById('black').style.visibility="hidden";
document.getElementById('blue').style.visibility="hidden";
document.getElementById('yellow').style.visibility="hidden";
}
else if(IncValue=="Yellow")
{
document.getElementById('yellow').style.visibility="visible"; …Run Code Online (Sandbox Code Playgroud) css ×3
html ×2
javascript ×2
angular ×1
angularfire2 ×1
angularjs ×1
css3 ×1
firebase ×1
google-maps ×1
html5 ×1
promise ×1
svg ×1