Title: Can't use method to generate route paths with compiler-cli · Issue #10731 · angular/angular · GitHub
Open Graph Title: Can't use method to generate route paths with compiler-cli · Issue #10731 · angular/angular
X Title: Can't use method to generate route paths with compiler-cli · Issue #10731 · angular/angular
Description: I'm submitting a ... (check one with "x") [?] bug report [x] feature request Current behavior export const generateRoute = function(route: string, params?: Object): string { return decodeURIComponent(Routing.generate(route, params).subst...
Open Graph Description: I'm submitting a ... (check one with "x") [?] bug report [x] feature request Current behavior export const generateRoute = function(route: string, params?: Object): string { return decodeURICompone...
X Description: I'm submitting a ... (check one with "x") [?] bug report [x] feature request Current behavior export const generateRoute = function(route: string, params?: Object): string { return de...
Opengraph URL: https://github.com/angular/angular/issues/10731
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Can't use method to generate route paths with compiler-cli","articleBody":"**I'm submitting a ...** (check one with \"x\")\n\n```\n[?] bug report\n[x] feature request\n```\n\n**Current behavior**\n\n``` typescript\nexport const generateRoute = function(route: string, params?: Object): string {\n return decodeURIComponent(Routing.generate(route, params).substr(1));\n};\n\nexport const routes: Routes = [\n {\n path: generateRoute('first_action'),\n component: MyFirstAction,\n },\n {\n path: generateRoute('second_action', {arg: ':arg'}),\n component: MySecondAction,\n },\n];\n```\n\n`ngc` error:\n\n``` log\nError: Error encountered resolving symbol values statically. Calling function 'generateRoute', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol\n```\n\ngenerateRoute generates a Route by name defined by the backend API. On each locale the route name can differ. If it _has_ to be static, we were required to create seperate builds for each locale.\n\n**Expected/desired behavior**\n\nDon't require the path to be known by `ngc`. Why does it have to? Does compile cli generate a custom router for the given routes?\n","author":{"url":"https://github.com/sod","@type":"Person","name":"sod"},"datePublished":"2016-08-12T10:32:07Z","url":"https://github.com/angular/angular/issues/10731"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:40739adb-c946-f19a-10e3-29326a8898a4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8B80:14700E:E5D3E5:124C399:6B0107DB |
| html-safe-nonce | 24a47faef41be25400129d1fbc7e41c4de9e35e7f716b3a0c94be73562d22d02 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjgwOjE0NzAwRTpFNUQzRTU6MTI0QzM5OTo2QjAxMDdEQiIsInZpc2l0b3JfaWQiOiIzODkyMzg2MDk3NDQ3MTEwNjE5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e525e0fd8066cfb9d4f051f5e863f59af4614967698983c0f3ceb937c4929f43 |
| hovercard-subject-tag | issue:170843668 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/10731/issue_layout |
| twitter:image | https://opengraph.githubassets.com/72f941db727c786f274cb625249ca5c29a491b4e4fd2213f06f81c5bcacaf560/angular/angular/issues/10731 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/72f941db727c786f274cb625249ca5c29a491b4e4fd2213f06f81c5bcacaf560/angular/angular/issues/10731 |
| og:image:alt | I'm submitting a ... (check one with "x") [?] bug report [x] feature request Current behavior export const generateRoute = function(route: string, params?: Object): string { return decodeURICompone... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sod |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width