我昨天没有问题,但今天我不能再跑git svn
了。它说:
git: 'svn' is not a git command. See 'git --help'.
The most similar commands are
fsck
mv
show
Run Code Online (Sandbox Code Playgroud)
我不知道它是否相关,但从昨天开始我更新了npm
(6.14.4) 和node
(v12.6.0)。
我在 macOS Catalina
在我的hybrid
应用程序中,可以拖动屏幕刷新列表.在Android
这个工作正常,iOS
但当我拖下来它有时会混淆它滚动页面,所以它有溢出/弹跳效果.
在ionic
有就是你可以用它来禁用此属性,但它不工作:
<ion-content id="questions" has-bouncing="false">
Run Code Online (Sandbox Code Playgroud)
config.xml已经有这些代码行:
<preference name="webviewbounce" value="false"/>
<preference name="UIWebViewBounce" value="false"/>
<preference name="DisallowOverscroll" value="true"/>
Run Code Online (Sandbox Code Playgroud) 我已经为onPress
方法添加了一个函数,但是在加载应用程序时会自动触发该函数.难道我做错了什么?
<TouchableHighlight onPress={this.showMenu()}>
<View></View>
</TouchableHighlight>
showMenu(){
this.state.showMenu = true;
}
Run Code Online (Sandbox Code Playgroud) 如果它是静态测试,则可以获取该值,但是每当我尝试获取转换后的值(使用ngx-translate
)时,它都是空的。
<div id="header-title">
<h1>{{ 'MENU_TITLE' | translate | uppercase }}</h1>
</div>
Run Code Online (Sandbox Code Playgroud)
这有效并返回Test
<div id="header-title">
<h1>Test</h1>
</div>
Run Code Online (Sandbox Code Playgroud)
规格
it('should translate a string using the key value', () => {
fixture = TestBed.createComponent(NavComponent);
const title = fixture.nativeElement;
console.log(title.querySelector('#header-title h1').innerHTML);
});
Run Code Online (Sandbox Code Playgroud)
导入翻译模块
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [RouterTestingModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
}),
HttpClientModule
],
declarations: [NavComponent]
}).compileComponents();
injector = getTestBed();
translate = injector.get(TranslateService);
}));
Run Code Online (Sandbox Code Playgroud)
----- FIXED -----但不确定这是否是正确的方法
let fixture: ComponentFixture<NavComponent>;
it('should …
Run Code Online (Sandbox Code Playgroud) 我无法覆盖css
for <md-progress-linear>
。
他们有以下代码来设置文件height
中的进度条sass
:
$progress-linear-bar-height: 5px !default;
md-progress-linear {
height: $progress-linear-bar-height;
}
Run Code Online (Sandbox Code Playgroud)
即使我改变5px
了1px
它仍然没有改变。忽略高度,也不会改变任何东西。
即使我把它放在我自己的sass
文件中,它也不会覆盖它:
md-progress-linear {
height: 2px !important;
}
Run Code Online (Sandbox Code Playgroud)
我在这里忽略了什么吗?
$progress-linear-bar-height: 1px !default;
md-progress-linear {
display: block;
position: relative;
width: 100%;
height: $progress-linear-bar-height;
padding-top: 0 !important;
margin-bottom: 0 !important;
}
<md-progress-linear md-mode="indeterminate" ng-if="showLoader"></md-progress-linear>
Run Code Online (Sandbox Code Playgroud) 我是新来的Unit Testing
,所以我只认识了Jasmine
和Karma
今天.
我安装了Karma:
npm init
npm install karma --save-dev
npm install -g karma-cli
npm install karma-jasmine --save-dev
npm install karma-chrome-launcher --save-dev
karma init
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试启动业力开始时,karma.conf.js
它会抛出一个错误:
Error: Cannot find module 'jasmine-core'
at Function.Module._resolveFilename (module.js:338:15)
at Function.require.resolve (module.js:389:19)
at initJasmine (/Users/appfoundry/Projects/Unit Testing/node_modules/karma-jasmine/lib/index.js:8:42)
at Array.invoke (/Users/appfoundry/Projects/Unit Testing/node_modules/di/lib/injector.js:75:15)
at get (/Users/appfoundry/Projects/Unit Testing/node_modules/di/lib/injector.js:48:43)
at /Users/appfoundry/Projects/Unit Testing/node_modules/karma/lib/server.js:137:20
at Array.forEach (native)
at Server._start (/Users/appfoundry/Projects/Unit Testing/node_modules/karma/lib/server.js:136:21)
at invoke (/Users/appfoundry/Projects/Unit Testing/node_modules/di/lib/injector.js:75:15)
at Server.start (/Users/appfoundry/Projects/Unit Testing/node_modules/karma/lib/server.js:101:18)
at Object.exports.run (/Users/appfoundry/Projects/Unit Testing/node_modules/karma/lib/cli.js:231:26)
at requireCliAndRun (/usr/local/lib/node_modules/karma-cli/bin/karma:44:16) …
Run Code Online (Sandbox Code Playgroud) 这可能是我错过了一些荒谬的东西,但当我添加object
到我的json
文件中时,NodeJs
它会在文件的末尾添加它(显然是?)]
var file = './data/questions.json';
fs.appendFile(file, ', ' + JSON.stringify(req.body), function (err) {
console.log(err);
});
Run Code Online (Sandbox Code Playgroud)
结果是这样的:
[
{'id':1, 'name':'Tom'}
], {'id':2, 'name':'Jerry'}
Run Code Online (Sandbox Code Playgroud) node.js ×2
angular ×1
angularjs ×1
css ×1
git ×1
git-svn ×1
ios ×1
jasmine ×1
javascript ×1
json ×1
react-native ×1
typescript ×1
unit-testing ×1