我在这里遇到的情况是,另一个合作者完成了 2 次提交,这似乎是错误的文件。我是存储库的所有者,并希望恢复由其他合作者完成的 2 次提交。从我的终端,我尝试了以下操作。
git log -2它只是说我所做的最后 2 次提交。我想知道如何重置最后 2 个提交并将 HEAD 更改为那些 2 个之前的提交。
我有一个三角形的多边形。但是多边形内部的文本没有渲染。任何帮助表示赞赏。这是我到目前为止所尝试的,我无法弄清楚为什么文本没有呈现。我真的可以在多边形内放置这样的点吗?
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 64 64">
<polygon fill="#F3BC23" stroke="#F3BC23" stroke-width="1" points="30,4 4,60 60,60"/><polygon>
<text x="10" y="14" text-anchor="middle" fill="white" font-size="10"></text>
Run Code Online (Sandbox Code Playgroud)
提前致谢。
我对 Jasmine 完全陌生,并试图学习如何在 Angular 4 中为我的组件编写单元测试。我正在向组件的 ngOnInit() 按钮的 classList 添加一个类。现在,当我尝试运行测试时,它说找不到 null 的属性“classList”。这是我到目前为止所尝试的。
组件.ts
ngOnInit() {
document.querySelector('.button-visible').classList.add('hidden');
}
Run Code Online (Sandbox Code Playgroud)
这就是我试图在我的规范 ts 文件中做的事情。
组件.spec.ts
describe('AppComponent', () => {
let component = AppComponent;
let fixture: ComponentFixture<AppComponent>;
let compiledElement;
});
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [AppComponent]
.....
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AppComponent);
component = fixture.componentInstance;
compiledElement = fixture.debugElement.nativeElement;
fixture.detectChanges();
});
it('should create component', () => {
expect(compiledElement.querySelector('button.button-visible').classList).toContain('hidden');
expect(component).toBeTruthy();
});
});
Run Code Online (Sandbox Code Playgroud)
我不知道如何测试。任何帮助表示赞赏。
我正在设计一个类似于布局的手风琴,并希望在我点击 div 时切换我显示的箭头图标。我能够切换 div 的内容。我想对箭头图标做同样的事情。
这是我到目前为止所尝试的。
$(document).ready(function() {
$(this).on("click", ".koh-faq-question", function() {
$(this).parent().find(".koh-faq-answer").toggle();
});
});Run Code Online (Sandbox Code Playgroud)
.koh-faqs-page-title {
font-family: Nexa W01 Heavy;
font-size: 30px;
color: #04202E;
font-weight: 700;
}
.koh-faq-question-span {
font-family: Helvetica Neue LT Pro Roman !important;
font-size: 16px !important;
color: #000 !important;
font-weight: 700 !important;
display: inline-block;
}
.koh-faq-answer {
font-family: Helvetica Neue LT Pro Roman;
color: #000;
font-weight: 400;
display: none;
}
.icon {
font-size: 10px;
padding-right: 5px;
}Run Code Online (Sandbox Code Playgroud)
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<div class="koh-tab-content">
<div …Run Code Online (Sandbox Code Playgroud)css ×2
angular ×1
git ×1
git-revert ×1
html ×1
jasmine ×1
javascript ×1
jquery ×1
svg ×1
typescript ×1
unit-testing ×1