我想获取查询字符串值.我使用$ location.search()来获取这些值,但它说$ location.search不是函数.我正在使用1.5版本的AngularJs.
JS -
var app = angular.module('myApp', []);
app.config(['$locationProvider', function($locationProvider){
$locationProvider.html5Mode(true);
}]);
app.controller('myCtrl',[ '$location','$scope', function($scope, $location){
var searchObject = $location.search();
console.log('searchObject');
console.log(searchObject);
}]);
Run Code Online (Sandbox Code Playgroud)
我不明白我在代码中缺少什么.
我在使用 ngTagInput 库时遇到奇怪的错误:
错误:无法更改类型属性。
这是该错误的屏幕截图 - Error Screenshot。
HTML 代码 -
<html ng-app="project">
<head>
<link href="/css/ng-tags-input.bootstrap.min.css" rel="stylesheet"/>
<link href="/css/ng-tags-input.min.css" rel="stylesheet" />
<script type="text/javascript" src='https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js'></script>
<script type="text/javascript" src="/assets/bootstrap-3.2.0-dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src='/js/angular.min.js'></script>
<script src="/js/ng-tags-input.min.js"></script>
<script src="/js/app.js"></script>
</head>
<body>
<form ng-controller="MainCtrl" role="form">
<div class="col-md-12 topM10px">
<tags-input ng-model="formInfo.tags" placeholder="Add a keyword"></tags-input>
</div>
<div class="col-md-12 topM10px">
<div ng-click="submitidea()" class="col-md-3 submitbtn">Submit</div>
</div>
</form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
控制器代码(app.js)-
var app = angular.module('project', ['ngTagsInput']);
app.controller('MainCtrl', function($scope, $http) {
$scope.formInfo = {};
$scope.tags = [
{ text: 'Tag1' }, …Run Code Online (Sandbox Code Playgroud) 我无法弄清楚如何删除默认的图标并将其替换为 Remix 中的自定义图标。在网页中,默认的图标被替换,但是当我在不同的选项卡中从我的网站打开媒体文件时,比如说我的网站上托管的图像或 PDF 文件,在这种情况下,会出现 Remix 的默认图标。
您可以在上面的屏幕截图中看到。在普通网页中,我的自定义图标工作正常。我是这样实现的 -
export function links() {
return [
{
rel: 'apple-touch-icon',
sizes: '180x180',
href: '/favicon/apple-touch-icon.png',
},
{
rel: 'icon',
type: 'image/png',
sizes: '32x32',
href: '/favicon/favicon-32x32.png',
},
{
rel: 'icon',
type: 'image/png',
sizes: '16x16',
href: '/favicon/favicon-16x16.png',
},
{
rel: 'icon',
type: 'image/x-icon',
href: '/favicon/favicon.ico',
},
{ rel: 'manifest', href: '/favicon/site.webmanifest' },
{
rel: 'mask-icon',
href: '/favicon/safari-pinned-tab.svg',
color: '#5bbad5',
},
]
}
Run Code Online (Sandbox Code Playgroud)
但对于托管媒体文件来说,这不起作用。任何帮助将不胜感激,谢谢:)
我想在模态弹出窗口中显示谷歌地图,但它似乎没有出现.需要帮忙.
这是HTML -
<div id="map-canvas" style="width: 600px; height: 450px; background-color: grey;padding:0;margin:0"></div>
Run Code Online (Sandbox Code Playgroud)
JS -
function initialize() {
var myloc = new google.maps.LatLng(-34.397, 150.644);
var mapOptions = {
zoom: 17,
center: myloc,
scrollwheel: false
};
var map = new google.maps.Map(document.getElementById('map-canvas'),mapOptions);
var marker = new google.maps.Marker({
position: map.getCenter(),
map: map,
animation: google.maps.Animation.BOUNCE
});
var contentString = '<div id="content" style="dir:rtl; text-align:right;">'+
'<div id="siteNotice">'+
'</div>'+
'<h1 id="firstHeading" class="firstHeading"><h1>title here</h1>'+
'<div id="bodyContent">'+
'<p>description here</p>'+
'</div>'+
'</div>';
var infowindow = new google.maps.InfoWindow({
content: contentString,
maxWidth: 250
}); …Run Code Online (Sandbox Code Playgroud) javascript jquery google-maps twitter-bootstrap bootstrap-modal
我无法将代码推送到 bitbucket 上。当我运行此命令“git push originbranch_name”时,它会给出错误 -
致命:无法访问“ https://user@bitbucket.org/folder/project.git/ ”:无法连接到 bitbucket.org 端口 443:网络无法访问。
怎么解决这个问题。有人帮忙吗?
我的要求是获取谷歌地方自动完成建议只适用于班加罗尔的地方,但如果我搜索除了班加罗尔以外的任何其他地方,那么我也得到我不想要的建议.我找到了很多与我的问题相关的stackoverflow链接,但没有一个能解决我的问题.
这有可能得到任何特定城市的建议吗?
我在下面分享我的代码: -
var input = (document.getElementById('address'));
var s_w = new google.maps.LatLng( 12.97232, 77.59480 ); //southwest
var n_e = new google.maps.LatLng( 12.89201, 77.58905 ); //northeast
var b_bounds = new google.maps.LatLngBounds( s_w, n_e ); //bangalorebounds
var options = {
bounds:b_bounds,
componentRestrictions: {country: "in"}
};
var autocomplete = new google.maps.places.Autocomplete(input, options);
autocomplete.bindTo('bounds', map);
autocomplete.addListener('place_changed', function() {
//rest_of_the_code
});
Run Code Online (Sandbox Code Playgroud)
请有人帮忙!
javascript ×4
angularjs ×2
google-maps ×2
autocomplete ×1
bitbucket ×1
favicon ×1
git ×1
jquery ×1
parameters ×1
proxy ×1
push ×1
reactjs ×1
remix.run ×1
url ×1