我想返回带有一些参数的上一页。有什么建议我该怎么做?
import {Location} from '@angular/common';
returnToPreviousPage(){
this._location.back();
}
Run Code Online (Sandbox Code Playgroud)
所以我想要的是这样的:
this._location.back(id:123);
Run Code Online (Sandbox Code Playgroud)
当我回到页面时看到这样的内容:www.test.com?d=123
所以我想做的是在中间和中间文本之间留出空间.这是我的小提琴:https://jsfiddle.net/abqy4w1f/.所以我希望左右两边是圆圈的10px.有什么建议吗?
.outter-h2 {
width: 200px;
text-align: center;
border-bottom: 1px solid #cccccc;
line-height: 0.1em;
margin: 35px auto 35px;
}
.outter-span {
background: #fff;
padding: 0 10px;
border: 1px solid #cccccc;
border-radius: 50%;
color: #bec3c7;
}Run Code Online (Sandbox Code Playgroud)
<h2 class="outter-h2"><span class="outter-span">?</span></h2>Run Code Online (Sandbox Code Playgroud)
我在我的html模板中使用此块:
<div *ngIf="visibleblock && !selected?.item?.externalInfo?.length > 0">
Run Code Online (Sandbox Code Playgroud)
但是当我这样做时我得到了这个错误:
ng build --prod --aot
Run Code Online (Sandbox Code Playgroud)
任何建议如何解决这个问题?
好吧,我有主头控制器,我有这个:
<div class="fade-show-hide" ng-class="{'ng-hide':loggedInClose==true}" ng-show="loggedInOpened" ng-cloak>
@Html.Partial("~/Views/Shared/_LoggedInPartial.cshtml")
</div>
Run Code Online (Sandbox Code Playgroud)
在脚本我有这个:
$ scope.loggedInClose = false;
$scope.toggleLoggedIn = function () {
$scope.loggedInOpened = !$scope.loggedInOpened;
$scope.languagesOpened = false;
$scope.loginOpened = false;
};
Run Code Online (Sandbox Code Playgroud)
问题是当我使用这个代码没有发生任何事情...我得到$scope.loggedInClose = true;但div不隐藏...
angular.element(document).on('click', function () {
$scope.loggedInClose = true;
});
Run Code Online (Sandbox Code Playgroud)
如果我点击页面上的任何地方,有人可以解释我如何隐藏div吗?
我有这个 :
if (this.router.url === '/test/sort') {
this.active = 0;
}
Run Code Online (Sandbox Code Playgroud)
问题是,有时url会test/sort?procesId=11在if语句中输入而不会输入.任何建议我怎么能这样做?
如何转换此字符串以获取1000000?问题是我总是得到10000:
console.log(parseFloat('10.000.000,00'.replace('.', ',').replace(/,(?=[^,]*$)/, '.')),'test');Run Code Online (Sandbox Code Playgroud)
有什么建议么?
如何获得当年的所有文章?
Articles::all()->where('created_at',$current_year);
Run Code Online (Sandbox Code Playgroud) 所以我想为Carbon设置语言,但是我总是得到相同的结果。
Carbon::setLocale('es');
$archive_current_year = Articles::whereBetween('created_at', [
Carbon::now()->startOfYear(),
Carbon::now()->endOfYear(),
])->get()->groupBy(function($item) {
return $item->created_at->format('F');
});
Run Code Online (Sandbox Code Playgroud) 我有这个表格:
<form id="login-form" class="text-left" (ngSubmit)="submitLogin()">
<div class="login-form-main-message"></div>
<div class="main-login-form">
<div class="login-group">
<div class="form-group">
<label for="lg_username" class="sr-only">Username</label>
<input type="text" class="form-control" id="lg_username" name="lg_username" placeholder="username" [(ngModel)]="username">
</div>
<div class="form-group">
<label for="lg_password" class="sr-only">Password</label>
<input type="password" class="form-control" id="lg_password" name="lg_password" placeholder="password" [(ngModel)]="password">
</div>
</div>
<button type="submit" class="login-button"><i class="fa fa-chevron-right" ></i>LOGIN</button>
</div>
</form>
Run Code Online (Sandbox Code Playgroud)
在组件中我有这个:
submitLogin(){
// Variable to hold a reference of addComment/updateComment
}
Run Code Online (Sandbox Code Playgroud)
我有登录组件:
import {Component, EventEmitter, Input, OnChanges} from '@angular/core';
import {Observable} from 'rxjs/Rx';
import { LoginService } from '../services/login.service';
import { Login } from …Run Code Online (Sandbox Code Playgroud) 我有两个组成部分,父母和孩子.在孩子我有按钮.当用户点击子节点中的那个按钮时,我想要调用父节点中的方法.有什么建议吗?