本文整理匯總了TypeScript中angular2/src/alt_router/router_url_serializer.DefaultRouterUrlSerializer.serialize方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript DefaultRouterUrlSerializer.serialize方法的具體用法?TypeScript DefaultRouterUrlSerializer.serialize怎麽用?TypeScript DefaultRouterUrlSerializer.serialize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類angular2/src/alt_router/router_url_serializer.DefaultRouterUrlSerializer
的用法示例。
在下文中一共展示了DefaultRouterUrlSerializer.serialize方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it("should update relative subtree (when does not start with ./)", () => {
let p = parser.parse("/a(ap)/c(cp)");
let c = p.firstChild(p.root);
let tree = s(c);
let t = link(tree.root, tree, p, ["c2"]);
expect(parser.serialize(t)).toEqual("/a(aux:ap)/c2(aux:cp)");
});
示例2: it
it("should parse an empty aux route definition", () => {
let tree = url.parse("/one()");
let c = tree.children(tree.root);
expectSegment(c[0], "one");
expect(tree.children(c[0]).length).toEqual(0);
expect(url.serialize(tree)).toEqual("/one");
});
示例3: it
it('should update parameters', () => {
let p = parser.parse("/a;aa=11");
let t = link(s(p.root), p, ["/a", {aa: 22, bb: 33}]);
expect(parser.serialize(t)).toEqual("/a;aa=22;bb=33");
});