本文整理汇总了TypeScript中@angular/common/http/src/params.HttpParams类的典型用法代码示例。如果您正苦于以下问题:TypeScript HttpParams类的具体用法?TypeScript HttpParams怎么用?TypeScript HttpParams使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HttpParams类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should not repeat mutations that have already been materialized', () => {
const body = new HttpParams({fromString: 'a=b'});
const mutated = body.append('a', 'c');
expect(mutated.toString()).toEqual('a=b&a=c');
const mutated2 = mutated.append('c', 'd');
expect(mutated.toString()).toEqual('a=b&a=c');
expect(mutated2.toString()).toEqual('a=b&a=c&c=d');
});
示例2: it
it('should give an accurate list of keys', () => {
const body = new HttpParams({fromString: 'a=1&b=2&c=3&d=4'});
expect(body.keys()).toEqual(['a', 'b', 'c', 'd']);
});