我有两个问题,我的项目是在ANGULAR 5中.
我正在寻找一种生成HTML到PDF的方法.生成的pdf不应该是图像.它应该像Actual PDF用户可以复制文本等.
注意:请不要建议jsPdf.
另一种方法是寻找一种方法将带有插入值的整个HTML发送到端点.我试图发送的Html只是内容可编辑的div.
我怎样才能做到这一点?
帮助和建议将不胜感激.谢谢
嗨,问题是我给输入绝对位置,但我发现绝对位置不能在输入标签中工作,任何人都可以知道吗?我只是想通过定位我的布局液体这就是为什么我在这里使用这是我的Html代码:
<div id="savevalue">
<input type="text" name="name" id="name" class="inpt" />
<input type="button" value="Submit" class="btn" />
</div>
Run Code Online (Sandbox Code Playgroud)
这是css代码:
.inpt{
background:#fff;
border:1px solid #ccc;
height:30px;
font-size:18px;
position:absolute;
left:0;
right:100px;
}
.btn{
height:30px;
background:#333;
border:1px solid #222;
font-size:18px;
color:#fff;
padding:0 15px;
position:absolute;
right:0;
}
Run Code Online (Sandbox Code Playgroud) 我做了一个带有一些效果的按钮.当我在浏览器中测试时,它只能在mozilla中正常工作.我无法找到为什么不工作-webkit-浏览器可以有人告诉我为什么这个代码不工作检查这个小提琴http://jsfiddle.net/sarfarazdesigner/Qtw3x/
这是HTML代码
<button name="feat-btn" id="feat-btn" class="push-button" type="submit">
<span>Submit</span>
</button>
Run Code Online (Sandbox Code Playgroud)
这是css
.push-button {
background: none repeat scroll 0 0 transparent;
border: medium none;
color: #FFFFFF;
cursor: pointer;
display: inline-block;
font-size: 18px;
padding: 0;
text-align: center;
text-decoration: none;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}
.push-button span:after {
-moz-border-bottom-colors: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
border-color: #357536 transparent -moz-use-text-color;
border-image: none;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-style: solid solid none;
border-width: 5px 5px 0;
content: …Run Code Online (Sandbox Code Playgroud) 我知道,我问一个很常见的问题,但我想知道是否有另一种方式animate 的element使用jQuery的唯一?我创建了一个动画,但我想改进它,我不知道怎么做.请检查这个小提琴看动画,或者你可以在这里看到它:walkoverapps.
我有点困惑.还有其他方法可以为元素设置动画吗?
我试图fail在我的代码段中调用条件。但是当我使用sinon.stub().throws()方法它显示我错误。我无法在代码中处理它。
这是我的片段:
login() {
let loginData = this.loginData;
return this.authService.login(loginData).then(userData => {
let msg = `${this.niceToSeeYouAgain} ${userData.email}!`;
this.userAlertsService.showSuccessToast(msg);
this.navigationService.afterLoggedIn();
//above lines are covered in test cases
}, errorInfo => {
// below line are needed to test
this.userAlertsService.showAlertToast(errorInfo);
});
}
Run Code Online (Sandbox Code Playgroud)
**这是我的单元测试片段:**
it('.login() - should throw exception - in failure case', sinon.test(() => {
let errorInfo = "some error";
let stub = sinon.stub(authService, 'login').throws();
let spy1 = sinon.spy(controller.userAlertsService, 'showAlertToast');
//call function
controller.login();
// $timeout.flush();
// expect things …Run Code Online (Sandbox Code Playgroud) html ×3
css ×2
absolute ×1
angular5 ×1
angularjs ×1
chai ×1
ecmascript-6 ×1
input ×1
jquery ×1
pdf ×1
position ×1
sinon ×1
typescript ×1
unit-testing ×1