我有这个功能,当我点击按钮时什么也没发生。我只是在控制台日志中得到 RESPONSE,但在那之后我什么也没得到。$viewContentLoaded 有问题。有什么建议吗?
$scope.ConfirmTicketPayOut = function (ticketPin, username) {
$scope.ticketPin = ticketPin;
localStorage.setItem("ticketPin", ticketPin);
accountDataProviderService.confirmTicketPayOut(ticketPin, username)
.then(function (response) {
$scope.confirmTicketPayOut = response;
console.log("RESPONSE: ", $scope.confirmTicketPayOut);
$scope.$on('$viewContentLoaded', function () {
console.log("VIEW CONTENT LOADED");
if ($scope.confirmTicketPayOut.Result == true) {
console.log("RETURN TRUE");
var w = $window.open('/account/ticketprint');
angular.element(w).bind('load', function () {
w.print();
});
}
});
});
}
Run Code Online (Sandbox Code Playgroud) 我有一个Id的列表,我希望所有人都能联系我的API.
我这样做的方式是这样的:
var someFunct = function() {
for (var i = 0; i < Apples.length; i++) {
var Apple = Apples[i];
$http.get("APIUrl" + Apple.Id).
success(function (response) {
for (var i = 0; i < response.Appleseeds.length; i++) {
if(Apple.Appleseeds.Id == response.Appleseeds.Id)
{
Apple.Size = response.Appleseeds.Size;
}
}
})
}
Run Code Online (Sandbox Code Playgroud)
所以问题在于Apple[2]
改变了价值,在哪里Apple[0]
并Apple[1]
保持不变.response.Appleseeds
拥有自己的Id列表.所以我需要改变所有应用程序的大小Apple[2]
.
我在CSS中有这个类,我需要在它的IE时更改它.我想删除padding-bottom
.我怎样才能做到这一点?
我不想添加另一个CSS文件,我想只更改一个类中的一个属性.
.container-wrapp{
float: left;
position: relative;
width: 100%;
padding-bottom:100px;
height: 100%;
}
Run Code Online (Sandbox Code Playgroud)
我试过这个但没有成功:
<!--[if IE]>
<style type="text/css">
.container-wrapp{
float: left;
position: relative;
width: 100%;
height: 100%;
}
</style>
<![endif]-->
Run Code Online (Sandbox Code Playgroud) 所以我在我的标题上有这个导航,但问题是当我点击链接并将我重定向到该页面时它会失去活动类.有什么建议吗?
<nav>
<div class="menu-topmenu-container">
<ul id="menu-topmenu" class="menu">
<li id="whats-on" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-53">
<a href="#whatson" class="active">What’s On</a>
</li>
<li id="menu-item-52" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-52">
<a href="visiting-us">Visiting Us</a>
</li>
<li id="menu-item-46" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-33 current_page_item menu-item-46">
<a href="collections-research">Collections & Research</a>
</li>
<li id="menu-item-50" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-50">
<a href="learning">Learning</a>
</li>
<li id="menu-item-49" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-49">
<a href="get-involved">Get Involved</a>
</li>
</ul>
</div>
</nav>
Run Code Online (Sandbox Code Playgroud)
我尝试了这个,但它不起作用:
$(function(){
var href=window.location.href;
$('nav a').each(function(e,i){
if (href.indexOf($(e).attr('href'))>=0)
{
$(e).addClass('active');
}
});
});
Run Code Online (Sandbox Code Playgroud) 我在 vue.js 中有一个值数组,但问题是我需要将这些值传递给控制器。我该怎么做,或者这是一种错误的方式?
这是在我的 vue.js 中获取值的地方:
additional_features: this.additionals_features
this.$http.patch('/profile/'+ user_id +'/property/'+ property_id +'/edit', property_credentials).then(function(response) {
$("html, body").animate({ scrollTop: 0 }, "slow");
this.property_status = true;
this.property_success_update_message = response.data.successUpdateMsg;
} , function(response) {
$("html, body").animate({ scrollTop: 0 }, "slow");
this.property_status = false;
this.property_errors = response.data
});
Run Code Online (Sandbox Code Playgroud)
这是我的控制器
$additional_features = $request->input('additionals_features');
Run Code Online (Sandbox Code Playgroud)
这是我的 html:
<input type="hidden" v-model="property_credentials.additional_features" name="additional_feature[]" value="@{{property_credentials.additional_features}}" />
Run Code Online (Sandbox Code Playgroud) 我知道当我运行此命令时:
php artisan serve --host=localhost
Run Code Online (Sandbox Code Playgroud)
当其他计算机位于同一网络上时,它可以工作,但是如果其他网络上的某人想要访问它,可以吗?我问,因为我目前无法检查。
我有这个对象:
this.prepaidObject = {
'customerType' : this.prepaidDetailForm.prepaidDetails.customerType,
'firstName' : this.prepaidDetailForm.prepaidDetails.firstName,
'lastName' : this.prepaidDetailForm.prepaidDetails.lastName,
'note' : this.prepaidDetailForm.prepaidDetails.note,
'created': this.prepaidDetailForm.prepaidDetails.created
};
Run Code Online (Sandbox Code Playgroud)
现在有时某些属性是未定义的。我想要的是如果this.prepaidDetailForm.prepaidDetails
未定义属性之一不显示它们。因此,例如,如果this.prepaidDetailForm.prepaidDetails.firsName
未定义,我不需要创建'firstName'
属性 isnide 对象。任何建议我该怎么做?
我有这个 :
for (const key of Object.keys(filter)) {
}
Run Code Online (Sandbox Code Playgroud)
问题是有时我得到后缀为 _1 的密钥,而不是:
keyName_1{
prop:'prop1'
}
Run Code Online (Sandbox Code Playgroud)
当我调用服务时,这个 keyName_1 是一个问题,所以我想要的总是替换这个 keyName1。我试过这个:
for (const key of Object.keys(filter)) {
if(key.includes('_1')){
key.replace('_1','');
}
}
Run Code Online (Sandbox Code Playgroud)
但是后来我丢失了那个键的对象值,所以我的道具不再存在。是否有任何选项可以仅更改密钥名称?
我想当用户输入这样的内容时:
"050" = "50"
"00050" = "50"
"000050" = "50"
"00000xxx" = "xxx"
"00,50" = "0,50"
"000,50" = "0,50"
"00000,xx" = "0,xx"
Run Code Online (Sandbox Code Playgroud)
它的字符串类型。有什么建议我可以实现吗?我尝试使用replace.this.value = vai替换掉所有零。
我想要达到的是每个字符串,如果没有逗号并以零开头以删除该零(它可以是多个零)。同样对于每个以零开头并且最后只取最后一个的字符串,所以当我输入0000000,40时得到0,40。
javascript ×4
angularjs ×2
laravel ×2
laravel-5 ×2
css ×1
jquery ×1
laravel-5.2 ×1
typescript ×1
vue.js ×1