| 
									
										
										
										
											2016-07-15 14:10:12 -07:00
										 |  |  | //- WARNING: _layout.jade and _layout-dart-api.jade should match in terms of content | 
					
						
							|  |  |  | //- except that one uses Harp partial/yield and the other uses Jade extends/include. | 
					
						
							| 
									
										
										
										
											2016-11-05 12:18:03 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | - function tsApiHrefToDart(match, hrefApi, dontcare1, urlRest) { | 
					
						
							|  |  |  | -   // Simple argument values: | 
					
						
							|  |  |  | -   // hrefApi: href="../api/ | 
					
						
							|  |  |  | -   // urlRest: core/index/ViewChild-var.html" | 
					
						
							|  |  |  | -   // console.log(`got match on ${match}, 1: ${hrefApi}, 3: ${urlRest}`); | 
					
						
							|  |  |  | -   var matches = urlRest.match(/^(\w*)\/index\/(\w*)-(\w*)(\.html")$/); | 
					
						
							|  |  |  | -   // console.log(`urlRest matches ${matches}`); | 
					
						
							|  |  |  | -   if (!matches) return match; // leave unchanged | 
					
						
							|  |  |  | -   var i = 1; // matches[0] corresponds to the fully matched result | 
					
						
							|  |  |  | -   var libName = matches[i++]; | 
					
						
							|  |  |  | -   var apiPageEntryName = matches[i++]; | 
					
						
							|  |  |  | -   var apiEntryKind = matches[i++]; | 
					
						
							|  |  |  | -   var suffix = matches[i++]; | 
					
						
							|  |  |  | -   return hrefApi + 'angular2.' + libName + '/' + apiPageEntryName + '-class' + suffix; | 
					
						
							|  |  |  | - } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-03 14:58:50 -07:00
										 |  |  | if jade2ng | 
					
						
							|  |  |  |   .side-nav--offset | 
					
						
							| 
									
										
										
										
											2015-02-27 07:17:29 -08:00
										 |  |  |     != partial("../_includes/_hero") | 
					
						
							| 
									
										
										
										
											2015-04-26 08:01:04 -07:00
										 |  |  |     != partial("../_includes/_banner") | 
					
						
							| 
									
										
										
										
											2016-10-03 14:58:50 -07:00
										 |  |  |     .l-content-small.grid-fluid.docs-content | 
					
						
							| 
									
										
										
										
											2016-10-12 09:48:30 -07:00
										 |  |  |       != yield | 
					
						
							| 
									
										
										
										
											2016-10-03 14:58:50 -07:00
										 |  |  | else | 
					
						
							|  |  |  |   doctype | 
					
						
							|  |  |  |   html(lang="en" ng-app="angularIOApp" itemscope itemtype="http://schema.org/Framework") | 
					
						
							|  |  |  |     // template: public/docs/_layout | 
					
						
							|  |  |  |     head | 
					
						
							|  |  |  |       != partial("../_includes/_head-include") | 
					
						
							|  |  |  |       block head-extra | 
					
						
							| 
									
										
										
										
											2015-03-01 06:42:31 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-03 14:58:50 -07:00
										 |  |  |     //- | 
					
						
							|  |  |  |     body(class="l-offset-nav l-offset-side-nav"  ng-controller="AppCtrl as appCtrl") | 
					
						
							|  |  |  |       != partial("../_includes/_main-nav") | 
					
						
							|  |  |  |       if current.path[2] | 
					
						
							|  |  |  |         != partial("_includes/_side-nav") | 
					
						
							|  |  |  |       != partial("../_includes/_hero") | 
					
						
							|  |  |  |       != partial("../_includes/_banner") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       if current.path[3] == 'api' | 
					
						
							|  |  |  |         if current.path[4] == 'index' | 
					
						
							| 
									
										
										
										
											2016-05-16 13:22:13 -04:00
										 |  |  |           != yield | 
					
						
							| 
									
										
										
										
											2016-10-03 14:58:50 -07:00
										 |  |  |         else | 
					
						
							|  |  |  |           article(class="l-content-small grid-fluid docs-content") | 
					
						
							|  |  |  |             != yield | 
					
						
							|  |  |  |       else if current.path.indexOf('cheatsheet') > 0 | 
					
						
							|  |  |  |         != yield | 
					
						
							| 
									
										
										
										
											2016-05-16 13:22:13 -04:00
										 |  |  |       else | 
					
						
							| 
									
										
										
										
											2016-10-03 14:58:50 -07:00
										 |  |  |         if current.path[3] == 'index' || current.path[3] == 'styleguide' | 
					
						
							|  |  |  |           article(class="l-content-small grid-fluid docs-content") | 
					
						
							|  |  |  |             != yield | 
					
						
							|  |  |  |         else | 
					
						
							| 
									
										
										
										
											2016-11-05 12:18:03 -07:00
										 |  |  |           - var isDart = current.path[1] === 'dart'; | 
					
						
							|  |  |  |           - var regex = /(href=\"(\.?\.\/)*api\/)(.*")/g; | 
					
						
							| 
									
										
										
										
											2016-10-03 14:58:50 -07:00
										 |  |  |           article(class="l-content-small grid-fluid docs-content") | 
					
						
							| 
									
										
										
										
											2016-11-05 12:18:03 -07:00
										 |  |  |             != !isDart ? yield : yield.replace(regex, tsApiHrefToDart) | 
					
						
							| 
									
										
										
										
											2016-10-03 14:58:50 -07:00
										 |  |  |               if (current.path[3] == 'guide' || current.path[3] == 'tutorial') && current.path[4] | 
					
						
							|  |  |  |                 != partial("../_includes/_next-item") | 
					
						
							| 
									
										
										
										
											2015-02-27 07:17:29 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-03 14:58:50 -07:00
										 |  |  |       != partial("../_includes/_footer") | 
					
						
							| 
									
										
										
										
											2016-10-12 09:48:30 -07:00
										 |  |  |       != partial("../_includes/_scripts-include") | 
					
						
							|  |  |  |       != partial("../_includes/_scripts-minimum") |