Option.SupplyData in spa Prerendering not working in production?
I folow tutorial .net core angular ssr in this link here,
in this part, I try passing some text and its working perfectly in development mode but not in production mode.
//on .net core
options.SupplyData = (context, data) =>
{
// Creates a new value that's passed to TypeScript code
data["meta"] = "title";
};
//angular, on main.server.ts
{ provide: 'MetaTitle', useValue: params.data.meta},
and i injecting to component to get data
constructor(
@Optional() @Inject("MetaTitle") private mtitle: any,
) {
}
i get value in development not in production code. how to resolve this, help
angular asp.net-core
add a comment |
I folow tutorial .net core angular ssr in this link here,
in this part, I try passing some text and its working perfectly in development mode but not in production mode.
//on .net core
options.SupplyData = (context, data) =>
{
// Creates a new value that's passed to TypeScript code
data["meta"] = "title";
};
//angular, on main.server.ts
{ provide: 'MetaTitle', useValue: params.data.meta},
and i injecting to component to get data
constructor(
@Optional() @Inject("MetaTitle") private mtitle: any,
) {
}
i get value in development not in production code. how to resolve this, help
angular asp.net-core
add a comment |
I folow tutorial .net core angular ssr in this link here,
in this part, I try passing some text and its working perfectly in development mode but not in production mode.
//on .net core
options.SupplyData = (context, data) =>
{
// Creates a new value that's passed to TypeScript code
data["meta"] = "title";
};
//angular, on main.server.ts
{ provide: 'MetaTitle', useValue: params.data.meta},
and i injecting to component to get data
constructor(
@Optional() @Inject("MetaTitle") private mtitle: any,
) {
}
i get value in development not in production code. how to resolve this, help
angular asp.net-core
I folow tutorial .net core angular ssr in this link here,
in this part, I try passing some text and its working perfectly in development mode but not in production mode.
//on .net core
options.SupplyData = (context, data) =>
{
// Creates a new value that's passed to TypeScript code
data["meta"] = "title";
};
//angular, on main.server.ts
{ provide: 'MetaTitle', useValue: params.data.meta},
and i injecting to component to get data
constructor(
@Optional() @Inject("MetaTitle") private mtitle: any,
) {
}
i get value in development not in production code. how to resolve this, help
angular asp.net-core
angular asp.net-core
asked Jan 2 at 0:59
Dwi Yanuar IlhamDwi Yanuar Ilham
18737
18737
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You didn't include much information about the project, so I'm going to make some assumptions to assist you. Go check these things out in your project
assuming that you are using the Angular CLI, make sure that the /dist folder is producing an acceptable index.html
make sure the /src/environment.prod.ts looks correct (similar in most cases) to the /src/environment/environment.ts file. This config file controls differences in production vs development builds on the Angular side.
hi, im using angular cli, the result of building angular is working fine and web is working. the only problem is passing value between the two.(.net core and angular) using supply data option.
– Dwi Yanuar Ilham
Jan 2 at 1:42
the only different environtment is UseAngularCliServer in development and not in production
– Dwi Yanuar Ilham
Jan 2 at 1:43
what happens when you overwrite that file with the contents of environment.ts and try ng build --prod?
– Goku
Jan 2 at 4:38
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54000160%2foption-supplydata-in-spa-prerendering-not-working-in-production%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You didn't include much information about the project, so I'm going to make some assumptions to assist you. Go check these things out in your project
assuming that you are using the Angular CLI, make sure that the /dist folder is producing an acceptable index.html
make sure the /src/environment.prod.ts looks correct (similar in most cases) to the /src/environment/environment.ts file. This config file controls differences in production vs development builds on the Angular side.
hi, im using angular cli, the result of building angular is working fine and web is working. the only problem is passing value between the two.(.net core and angular) using supply data option.
– Dwi Yanuar Ilham
Jan 2 at 1:42
the only different environtment is UseAngularCliServer in development and not in production
– Dwi Yanuar Ilham
Jan 2 at 1:43
what happens when you overwrite that file with the contents of environment.ts and try ng build --prod?
– Goku
Jan 2 at 4:38
add a comment |
You didn't include much information about the project, so I'm going to make some assumptions to assist you. Go check these things out in your project
assuming that you are using the Angular CLI, make sure that the /dist folder is producing an acceptable index.html
make sure the /src/environment.prod.ts looks correct (similar in most cases) to the /src/environment/environment.ts file. This config file controls differences in production vs development builds on the Angular side.
hi, im using angular cli, the result of building angular is working fine and web is working. the only problem is passing value between the two.(.net core and angular) using supply data option.
– Dwi Yanuar Ilham
Jan 2 at 1:42
the only different environtment is UseAngularCliServer in development and not in production
– Dwi Yanuar Ilham
Jan 2 at 1:43
what happens when you overwrite that file with the contents of environment.ts and try ng build --prod?
– Goku
Jan 2 at 4:38
add a comment |
You didn't include much information about the project, so I'm going to make some assumptions to assist you. Go check these things out in your project
assuming that you are using the Angular CLI, make sure that the /dist folder is producing an acceptable index.html
make sure the /src/environment.prod.ts looks correct (similar in most cases) to the /src/environment/environment.ts file. This config file controls differences in production vs development builds on the Angular side.
You didn't include much information about the project, so I'm going to make some assumptions to assist you. Go check these things out in your project
assuming that you are using the Angular CLI, make sure that the /dist folder is producing an acceptable index.html
make sure the /src/environment.prod.ts looks correct (similar in most cases) to the /src/environment/environment.ts file. This config file controls differences in production vs development builds on the Angular side.
answered Jan 2 at 1:27
GokuGoku
69611445
69611445
hi, im using angular cli, the result of building angular is working fine and web is working. the only problem is passing value between the two.(.net core and angular) using supply data option.
– Dwi Yanuar Ilham
Jan 2 at 1:42
the only different environtment is UseAngularCliServer in development and not in production
– Dwi Yanuar Ilham
Jan 2 at 1:43
what happens when you overwrite that file with the contents of environment.ts and try ng build --prod?
– Goku
Jan 2 at 4:38
add a comment |
hi, im using angular cli, the result of building angular is working fine and web is working. the only problem is passing value between the two.(.net core and angular) using supply data option.
– Dwi Yanuar Ilham
Jan 2 at 1:42
the only different environtment is UseAngularCliServer in development and not in production
– Dwi Yanuar Ilham
Jan 2 at 1:43
what happens when you overwrite that file with the contents of environment.ts and try ng build --prod?
– Goku
Jan 2 at 4:38
hi, im using angular cli, the result of building angular is working fine and web is working. the only problem is passing value between the two.(.net core and angular) using supply data option.
– Dwi Yanuar Ilham
Jan 2 at 1:42
hi, im using angular cli, the result of building angular is working fine and web is working. the only problem is passing value between the two.(.net core and angular) using supply data option.
– Dwi Yanuar Ilham
Jan 2 at 1:42
the only different environtment is UseAngularCliServer in development and not in production
– Dwi Yanuar Ilham
Jan 2 at 1:43
the only different environtment is UseAngularCliServer in development and not in production
– Dwi Yanuar Ilham
Jan 2 at 1:43
what happens when you overwrite that file with the contents of environment.ts and try ng build --prod?
– Goku
Jan 2 at 4:38
what happens when you overwrite that file with the contents of environment.ts and try ng build --prod?
– Goku
Jan 2 at 4:38
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54000160%2foption-supplydata-in-spa-prerendering-not-working-in-production%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown