From 359ca330240db2a630b4928a7eda47dbdc27bc6b Mon Sep 17 00:00:00 2001 From: Perry Govier Date: Fri, 15 Aug 2014 15:48:33 -0500 Subject: [PATCH] docs(templateCache): reformat to conform to ngDoc --- js/angular/service/templateCache.js | 33 ++++++----------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/js/angular/service/templateCache.js b/js/angular/service/templateCache.js index a9b21a65bf..dc7d00775d 100644 --- a/js/angular/service/templateCache.js +++ b/js/angular/service/templateCache.js @@ -6,17 +6,17 @@ * @ngdoc service * @name $ionicTemplateCache * @module ionic - * @description An angular service that preemptively caches template files to reduce flicker and boost performance. + * @description A service that preemptively caches template files to eliminate transition flicker and boost performance. * @usage * State templates are cached automatically, but you can optionally cache other templates. + * * ```js * $ionicTemplateCahce('myNgIncludeTemplate.html'); * ``` * * Optionally disable all preemptive caching with the `$ionicConfigProvider` or individual states by setting `prefetchTemplate` - * in the $state definition - * ```js - * $ionicTemplateCahce('myNgIncludeTemplate.html'); + * in the `$state` definition + * * ```js * angular.module('myApp', ['ionic']) * .config(function($stateProvider, $ionicConfigProvider) { @@ -54,12 +54,7 @@ IonicModule function($http, $templateCache, $timeout, $ionicConfig) { var toCache = templatesToCache, hasRun = false; - /** - * @ngdoc method - * @name $ionicTemplateCache - * @description Add template(s) to be cached. - * @param {string | array} string or array of strings of templates to cache. - */ + function $ionicTemplateCache(templates){ if(toCache.length > 500) return false; if(typeof templates === 'undefined')return run(); @@ -98,14 +93,7 @@ function($http, $templateCache, $timeout, $ionicConfig) { return $ionicTemplateCache; }]) -/** - * @ngdoc config - * @name $ionicTemplateCache - * @module ionic - * @private - * - * Intercepts the $stateprovider.state() command to look for templateUrls that can be cached - */ +// Intercepts the $stateprovider.state() command to look for templateUrls that can be cached .config([ '$stateProvider', '$ionicConfigProvider', @@ -127,14 +115,7 @@ function($stateProvider, $ionicConfigProvider) { }; }]) -/** - * @ngdoc run - * @name $ionicTemplateCache - * @module ionic - * @private - * - * process the templateUrls collected by the $stateProvider, adding them to the cache - */ +// process the templateUrls collected by the $stateProvider, adding them to the cache .run(function($ionicTemplateCache) { $ionicTemplateCache(); });