有谁知道原因:
" <exception>".LastIndexOf("<",0) returns -1 (wrong)
Run Code Online (Sandbox Code Playgroud)
而
" <exception>".LastIndexOf("<") returns 2 (right)
Run Code Online (Sandbox Code Playgroud)
和
"<exception>".LastIndexOf("<",0) returns 0 (right)
Run Code Online (Sandbox Code Playgroud)
这是一个错误还是我误解了LastIndexOf-Method?
我想使用以下代码将数据传递给POST JSON Web服务.
NSString *urlString = @"http://3.10.204.99:9090/service/outage/data/getShortFormData";
NSDictionary *inputData = [[NSDictionary alloc] initWithObjectsAndKeys:
@"1020", @"outageId",
@"Alex", @"customerName",
nil];
NSError *error = nil;
NSData *jsonInputData = [NSJSONSerialization dataWithJSONObject:inputData options:NSJSONWritingPrettyPrinted error:&error];
NSString *jsonInputString = [[NSString alloc] initWithData:jsonInputData encoding:NSUTF8StringEncoding];
[self checkWithServer:urlString jsonString:jsonInputString];
Run Code Online (Sandbox Code Playgroud)
-(void)checkWithServer:(NSString *)urlname jsonString:(NSString *)jsonString{
NSURL *url1 = [NSURL URLWithString:urlname];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url1];
[request setHTTPMethod:@"POST"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request setValue:@"charset=utf-8" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:[jsonString dataUsingEncoding:NSUTF8StringEncoding]];
NSURLResponse *response;
NSError *err;
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&err];
id jsonResponseData = [NSJSONSerialization JSONObjectWithData:responseData …Run Code Online (Sandbox Code Playgroud) 我将这些动态组件声明为模块中的入口组件,我也想在其中呈现它们.使用JIT它可以正常工作.以下结构有我的应用程序的一部分,我想渲染它们:app -> home (lazy) -> contracts (lazy) -> search.
所以我将这些组件添加到我用于的模块中search component/route.当我使用AOT进行编译时,每次访问搜索路径时,该应用程序都会告诉我没有组件工厂.当然我搜索谷歌并找到了一些结果:
我尝试将它们添加到ANALYZE_FOR_ENTRY_COMPONENTS提供程序中,我尝试.forRoot()在我的app.module中导入ModuleWithProviders,我也尝试在根模块(app.module)中导入和声明我的动态及其所有依赖组件.一切都导致了同样的错误.
我声明我的动态组件作为入口组件,如:所以
Run Code Online (Sandbox Code Playgroud)
@NgModule({
imports: [SharedComponentsModule, FinoSchemaFormsModule, TabGroupModule, FinoInputModule],
declarations: [EnergySearchSettingsComponent, DslSearchSettingsComponent, MobileSearchSettingsComponent, ComparisonDetailSectionComponent],
entryComponents: [EnergySearchSettingsComponent, DslSearchSettingsComponent, MobileSearchSettingsComponent],
exports: [EnergySearchSettingsComponent, DslSearchSettingsComponent, MobileSearchSettingsComponent, ComparisonDetailSectionComponent],
providers: [CategoryMappingProvider]
})
export class ComparisonComponentsModule { }
This module gets imported in the SearchModule我SearchComponent的声明.在这个组件中,我想使用ComponentFactoryResolverI注入动态渲染这些组件SearchComponent.
ngOnInit() {
this.searchSettingsComponent = this.comparisonService.getSearchComponent(); // returns either EnergySearchSettingsComponent, DslSearchSettingsComponent or MobileSearchSettingsComponent
let componentFactory = this.componentFactoryResolver.resolveComponentFactory(searchSettingsComponent); …Run Code Online (Sandbox Code Playgroud) 有谁知道IE和Firefox是否以及何时支持css形状功能,特别是shape-outside?
angular ×1
angular5 ×1
c# ×1
css ×1
css-shapes ×1
indexof ×1
ios ×1
javascript ×1
json ×1
lazy-loading ×1
post ×1
shape ×1
string ×1