MCPcopy Index your code
hub / github.com/angular/angular-cli / fromObject

Method fromObject

packages/angular/ssr/src/routes/route-tree.ts:175–183  ·  view source on GitHub ↗

* Constructs a `RouteTree` from an object representation. * This method is used to recreate a `RouteTree` instance from an array of metadata objects. * The array should be in the format produced by `toObject`, allowing for the reconstruction of the route tree * with the same routes and meta

(value: SerializableRouteTreeNode)

Source from the content-addressed store, hash-verified

173 * @returns A new `RouteTree` instance constructed from the provided metadata objects.
174 */
175 static fromObject(value: SerializableRouteTreeNode): RouteTree {
176 const tree = new RouteTree();
177
178 for (const { route, ...metadata } of value) {
179 tree.insert(route, metadata);
180 }
181
182 return tree;
183 }
184
185 /**
186 * A generator function that recursively traverses the route tree and yields the metadata of each node.

Callers 2

route-tree_spec.tsFile · 0.80
fromMethod · 0.80

Calls 1

insertMethod · 0.95

Tested by

no test coverage detected