我有一个电子表格,其中每个引号中包含4条常量行。根据报价中的订单项数量,这4条常规行所在的行会有所不同。我正在尝试找到一个代码,该代码在B列中找到“ SHOP TICKETS”一词,然后删除该行及其下的3个而不包含循环。该循环不是必需的,似乎使它陷入困境。我已经待了两天了,但似乎找不到正确的代码。
我已经尝试了For Each,With,Find等一系列在线解决方案,但似乎都无法正常工作。除了一个昏暗的人,但它减慢了速度,以至于不值得保留。我是新人/自学成才,所以请耐心等待我。
答案 0 :(得分:1)
import { Component, OnInit } from '@angular/core';
import {HttpClient} from '@angular/common/http';
@Component({
selector: 'app-test',
templateUrl: './test.component.html',
styleUrls: ['./test.component.css']
})
export class TestComponent implements OnInit {
articles: any[];
url = 'https://example.zendesk.com/api/v2/users.json';
constructor(private httpClient: HttpClient) { }
ngOnInit() {
this.getArticles(this.url, this.articles);
}
getArticles(url: string, articles: any[]) {
this.httpClient.get(url).subscribe(data => {
if (articles === undefined) { articles = data['articles']; } else { articles = articles.concat(data['articles']); }
if (data['next_page'] != null) {
this.getArticles(data['next_page'], articles);
} else { console.log('Finished'); }
this.articles = articles;
});
}
}
答案 1 :(得分:0)
cityRepository.getAllCities()
我明白了!!谢谢。与小组进行交谈很有帮助。