Giter Club home page Giter Club logo

angular-meta-title's Introduction

Installation

  1. bower install --save angular-meta-title
  2. including script file provided by bower component sprintf into your application
  3. including angular-meta-title.js script file provided by this component into your application
  4. adding l42y.meta.title as a module dependency to your application

Usage

Configuration

angular.module('App', [
    'l42y.meta.title'
]).config(function (
    TitleProvider
) {
    TitleProvider.config({
        name: 'Site name',
        slogan: 'Site slogan',
        format: '%(name)s · %(slogan)s'
    });
}).config(function (
    $routeProvider
) {
    $routeProvider.when('/about', {
        title: {
            page: 'About',
            format: '%(page)s · %(name)s'
        },
        controller: 'AboutCtrl',
        templateUrl: 'views/pages/about.html'
    });
}).controller('GlobalCtrl', function (
    Title
) {
    this.title = Title;
}).controller('AboutCtrl', function (
    Title
) {
    Title.set({
        page: '关于'
        format: '%(page)s'
    });
});

Binding

<html ng-app="App" ng-controller="GlobalCtrl as g">
    <head>
        <title ng-bind="g.title.content">Site name</title>
    </head>
</html>

License

WTFPL

angular-meta-title's People

Contributors

l42y avatar

Stargazers

 avatar  avatar

Watchers

 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.