Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Create Title provider #487

Closed
2 of 10 tasks
gjuchault opened this issue Jul 19, 2016 · 2 comments
Closed
2 of 10 tasks

Create Title provider #487

gjuchault opened this issue Jul 19, 2016 · 2 comments

Comments

@gjuchault
Copy link

Note: for support questions, please use one of these channels: https://github.com/angular/universal/blob/master/CONTRIBUTING.md#question. This repository's issues are reserved for feature requests and bug reports.

  • I'm submitting a ...
  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.
  • What modules are related to this pull-request
  • express-engine
  • grunt-prerender
  • gulp-prerender
  • hapi-engine
  • universal-preview
  • universal
  • webpack-prerender
  • What is the current behavior?

Error when using Title provider
EXCEPTION: No provider for Title!

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem by creating a github repo.

app.component.ts

export class AppComponent {
  constructor(private title: Title) {
    title.setTitle('Foobar');
  }
}```

main.node.ts
```ts
import {
    ...
    Title
} from 'angular2-universal';

export function ngApp(req: Request, res: Response): void {
  // ...
  const config: BootloaderConfig = {
    ...
    providers: [
      ...
      Title,

main.browser.ts

import { Title } from '@angular/platform-browser';

bootstrap(AppComponent, [
    ...
    Title
]);
  • What is the expected behavior?

No errors, the file should get its <title> tag replaced

  • What is the motivation / use case for changing the behavior?

SEO

  • Please tell us about your environment:
  • Angular version: 2.0.0-RC.4
  • Browser: all
  • Language: all
  • OS: all
  • Platform: NodeJS
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
@gjuchault
Copy link
Author

Already in #309

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant