From 8554e38dd292fd788f9f77a77fc79ca2f8f055c2 Mon Sep 17 00:00:00 2001 From: Kapunahele Wong Date: Wed, 12 Apr 2017 15:08:44 -0400 Subject: [PATCH] docs(doc-title-cookbook): apply guidelines (#3537) --- .../latest/cookbook/set-document-title.jade | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/public/docs/ts/latest/cookbook/set-document-title.jade b/public/docs/ts/latest/cookbook/set-document-title.jade index 832738239e..d7dbced5c1 100644 --- a/public/docs/ts/latest/cookbook/set-document-title.jade +++ b/public/docs/ts/latest/cookbook/set-document-title.jade @@ -2,10 +2,10 @@ include ../_util-fns a(id='top') :marked - Our app should be able to make the browser title bar say whatever we want it to say. + Your app should be able to make the browser title bar say whatever you want it to say. This cookbook explains how to do it. :marked - **See the **. + See the . table tr @@ -28,11 +28,11 @@ code-example(format=''). <title>{{This_Does_Not_Work}}</title> :marked Sorry but that won't work. - The root component of our application is an element contained within the `` tag. + The root component of the application is an element contained within the `` tag. The HTML `` is in the document `<head>`, outside the body, making it inaccessible to Angular data binding. - We could grab the browser `document` object and set the title manually. - That's dirty and undermines our chances of running the app outside of a browser someday. + You could grab the browser `document` object and set the title manually. + That's dirty and undermines your chances of running the app outside of a browser someday. .l-sub-section :marked Running your app outside a browser means that you can take advantage of server-side @@ -46,19 +46,19 @@ code-example(format=''). The [Title](../api/platform-browser/index/Title-class.html) service is a simple class that provides an API for getting and setting the current HTML document title: - * `getTitle() : string` — Gets the title of the current HTML document. - * `setTitle( newTitle : string )` — Sets the title of the current HTML document. + * `getTitle() : string`—Gets the title of the current HTML document. + * `setTitle( newTitle : string )`—Sets the title of the current HTML document. - Let's inject the `Title` service into the root `AppComponent` and expose a bindable `setTitle` method that calls it: + You can inject the `Title` service into the root `AppComponent` and expose a bindable `setTitle` method that calls it: +makeExample( "cb-set-document-title/ts/src/app/app.component.ts", "class", "src/app/app.component.ts (class)" )(format='.') :marked - We bind that method to three anchor tags and, voilĂ ! + Bind that method to three anchor tags and voilĂ ! figure.image-display img(src="/resources/images/cookbooks/set-document-title/set-title-anim.gif" alt="Set title") :marked - Here's the complete solution + Here's the complete solution: +makeTabs( `cb-set-document-title/ts/src/main.ts, @@ -76,17 +76,18 @@ figure.image-display .l-main-section :marked - ## Why we provide the *Title* service in *bootstrap* + ## Why provide the *Title* service in *bootstrap* - We generally recommended providing application-wide services in the root application component, `AppComponent`. + Generally you want to provide application-wide services in the root application component, `AppComponent`. - Here we recommend registering the title service during bootstrapping, - a location we reserve for configuring the runtime Angular environment. + This cookbook recommends registering the title service during bootstrapping, + a location you reserve for configuring the runtime Angular environment. - That's exactly what we're doing. + That's exactly what you're doing. The `Title` service is part of the Angular *browser platform*. - If we bootstrap our application into a different platform, - we'll have to provide a different `Title` service that understands the concept of a "document title" for that specific platform. - Ideally the application itself neither knows nor cares about the runtime environment. + If you bootstrap your application into a different platform, + you'll have to provide a different `Title` service that understands + the concept of a "document title" for that specific platform. + Ideally, the application itself neither knows nor cares about the runtime environment. :marked [Back to top](#top)