GithubHelp home page GithubHelp logo

chromepenguin / ember-document-title Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ember-cli/ember-page-title

0.0 2.0 0.0 650 KB

A component for changing your document.title

License: MIT License

JavaScript 85.34% Handlebars 4.88% HTML 9.59% CSS 0.19%

ember-document-title's Introduction

document.title for Ember Ember Observer Score Build Status Code Climate

This addon provides a component for changing the title of the page you're on.

Installing via ember-cli

If inside an ember-cli project, you can install the component as an addon:

ember install:addon ember-document-title

Usage

To start, let's add a root title for your application. This goes in application.hbs.

{{#document-title}}My App{{/document-title}}

This sets the title for your application. When your application loads, you should see the title My App appear. If you would like a block-less version of this component, it's available by setting the title property:

{{document-title title="My App"}}

By default, using the component will allow an interaction where additional titles are appended to the root:

Defaults

You can change the separator by specifying the separator attribute.

Custom Separator

Separators can be changed at arbitrary levels:

Custom Separator

Titles can be prepended to the parent, by setting the prepend attribute to true.

Prepend

This allows one to swap the order at arbitrary levels:

Nested Prepend

And for special templates that need to complete control over the title, set the replace attribute to true. This will only apply for that level.

Replace

In addition, there's no limit to the amount of titles you can put in a route:

Replace

API

attribute type default
separator string `"
prepend boolean false
replace boolean false

ember-document-title's People

Contributors

ember-tomster avatar pimterry avatar tim-evans avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.