diff --git a/Rakefile b/Rakefile index 55ed8d03..9c18da9d 100644 --- a/Rakefile +++ b/Rakefile @@ -90,6 +90,10 @@ task :compile => [:init, :compile_scenario, :compile_jstd_scenario_adapter] do concat_module('resource', ['src/ngResource/resource.js']) concat_module('cookies', ['src/ngCookies/cookies.js']) + concat_module('bootstrap', ['src/bootstrap/bootstrap.js']) + concat_module('bootstrap-prettify', ['src/bootstrap/bootstrap-prettify.js', + 'src/bootstrap/google-prettify/prettify.js'], + gen_css('src/bootstrap/google-prettify/prettify.css', true)) FileUtils.cp 'src/ngMock/angular-mocks.js', path_to('angular-mocks.js') @@ -99,6 +103,8 @@ task :compile => [:init, :compile_scenario, :compile_jstd_scenario_adapter] do closure_compile('angular-loader.js') closure_compile('angular-resource.js') closure_compile('angular-sanitize.js') + closure_compile('angular-bootstrap.js') + closure_compile('angular-bootstrap-prettify.js') end @@ -159,10 +165,7 @@ task :package => [:clean, :compile, :docs] do "#{pkg_dir}/docs-#{NG_VERSION.full}/index-jq-debug.html" ].each do |src| rewrite_file(src) do |content| - content.sub!('angular.js', "angular-#{NG_VERSION.full}.js"). - sub!('angular-resource.js', "angular-resource-#{NG_VERSION.full}.js"). - sub!('angular-cookies.js', "angular-cookies-#{NG_VERSION.full}.js"). - sub!('angular-sanitize.js', "angular-sanitize-#{NG_VERSION.full}.js") + content.gsub!(/'angular(.*)\.js/, '\'angular\1-' + NG_VERSION.full + '.js') end end @@ -305,8 +308,8 @@ def concat_file(filename, deps, footer='') end -def concat_module(name, files) - concat_file('angular-' + name + '.js', ['src/module.prefix'] + files + ['src/module.suffix']) +def concat_module(name, files, footer='') + concat_file('angular-' + name + '.js', ['src/module.prefix'] + files + ['src/module.suffix'], footer) end diff --git a/angularFiles.js b/angularFiles.js index fa633be7..309aa2b3 100644 --- a/angularFiles.js +++ b/angularFiles.js @@ -59,7 +59,7 @@ angularFiles = { 'src/ng/directive/ngView.js', 'src/ng/directive/script.js', 'src/ng/directive/select.js', - 'src/ng/directive/style.js' + 'src/ng/directive/style.js', ], 'angularSrcModules': [ @@ -68,7 +68,9 @@ angularFiles = { 'src/ngSanitize/sanitize.js', 'src/ngSanitize/directive/ngBindHtml.js', 'src/ngSanitize/filter/linky.js', - 'src/ngMock/angular-mocks.js' + 'src/ngMock/angular-mocks.js', + + 'src/bootstrap/bootstrap.js' ], 'angularScenario': [ @@ -96,6 +98,7 @@ angularFiles = { 'test/ngScenario/jstd-scenario-adapter/*.js', 'test/*.js', 'test/auto/*.js', + 'test/bootstrap/*.js', 'test/ng/*.js', 'test/ng/directive/*.js', 'test/ng/filter/*.js', diff --git a/docs/content/api/index.ngdoc b/docs/content/api/index.ngdoc index 9f1bb398..88e354f5 100644 --- a/docs/content/api/index.ngdoc +++ b/docs/content/api/index.ngdoc @@ -2,62 +2,6 @@ @name API Reference @description -## Angular Compiler API - -* {@link angular.module.ng.$compileProvider.directive Directives} - Angular DOM element attributes -* {@link angular.module.ng.$filter Filters} - Angular output filters -* {@link angular.module.ng.$compile $compile} - Template compiler - -## Angular Scope API - -* {@link angular.module.ng.$rootScope.Scope Scope Object} - Angular scope object - - -## Angular Services & Dependency Injection API - -* {@link angular.module.ng Angular Services} -* {@link angular.injector angular.injector() } - - -## Angular Testing API - -* {@link angular.module.ngMock Testing Mocks API} - Mock objects for testing -* {@link guide/dev_guide.e2e-testing Angular Scenario Runner} - Automated scenario testing -documentation - - -## Angular Utility Functions - -### HTML & DOM Manipulation - -* {@link angular.element angular.element()} - -### Misc - -* {@link angular.bind angular.bind() } -* {@link angular.extend angular.extend() } -* {@link angular.forEach angular.forEach() } -* {@link angular.identity angular.identity() } -* {@link angular.noop angular.noop() } - - -## Type Identification - -* {@link angular.isArray angular.isArray() } -* {@link angular.isDate angular.isDate() } -* {@link angular.isDefined angular.isDefined() } -* {@link angular.isFunction angular.isFunction() } -* {@link angular.isNumber angular.isNumber() } -* {@link angular.isObject angular.isObject() } -* {@link angular.isString angular.isString() } -* {@link angular.isUndefined angular.isUndefined() } - -## Strings - -* {@link angular.lowercase angular.lowercase() } -* {@link angular.uppercase angular.uppercase() } - -### JSON - -* {@link angular.fromJson angular.fromJson() } -* {@link angular.toJson angular.toJson() } +Use the API Refference documentation when you need more information about a specific feature. Check out +{@link guide/ Developer Guide} for AngularJS concepts. If you are new to AngularJS we recomend the +{@link tutorial/ Tutorial}. diff --git a/docs/content/cookbook/deeplinking.ngdoc b/docs/content/cookbook/deeplinking.ngdoc index f242f82e..491e3b79 100644 --- a/docs/content/cookbook/deeplinking.ngdoc +++ b/docs/content/cookbook/deeplinking.ngdoc @@ -30,72 +30,111 @@ In this example we have a simple app which consist of two screens: * Welcome: url `welcome` Show the user contact information. * Settings: url `settings` Show an edit screen for user contact information. + + + angular.module('deepLinking', ['ngSanitize']) + .config(function($routeProvider) { + $routeProvider. + when("/welcome", {template:'welcome.html', controller:WelcomeCntl}). + when("/settings", {template:'settings.html', controller:SettingsCntl}); + }); -The two partials are defined in the following URLs: + AppCntl.$inject = ['$scope', '$route'] + function AppCntl($scope, $route) { + $scope.$route = $route; -* ./examples/settings.html -* ./examples/welcome.html + // initialize the model to something useful + $scope.person = { + name:'anonymous', + contacts:[{type:'email', url:'anonymous@example.com'}] + }; + } - - - + .partial-info { + background-color: blue; + color: white; + padding: 3px; + } + +

Your App Chrome

[ Welcome | Settings ]
- + Partial: {{$route.current.template}} - +
Your app footer
- - +
+ + + + +
+ + + [ X ] +
+
+ [ add ] +
+ + + +
+ + Hello {{person.name}}, +
+ Your contact information: +
{{contact.type}}: + +
+
+
+ it('should navigate to URL', function() { - element('a:contains(Welcome)').click(); - expect(element('ng\\:view').text()).toMatch(/Hello anonymous/); - element('a:contains(Settings)').click(); - input('form.name').enter('yourname'); - element(':button:contains(Save)').click(); - element('a:contains(Welcome)').click(); - expect(element('ng\\:view').text()).toMatch(/Hello yourname/); + element('a:contains(Welcome)').click(); + expect(element('[ng-view]').text()).toMatch(/Hello anonymous/); + element('a:contains(Settings)').click(); + input('form.name').enter('yourname'); + element(':button:contains(Save)').click(); + element('a:contains(Welcome)').click(); + expect(element('[ng-view]').text()).toMatch(/Hello yourname/); }); - - + +
diff --git a/docs/content/guide/dev_guide.bootstrap.ngdoc b/docs/content/guide/dev_guide.bootstrap.ngdoc index 02351ede..391475ca 100644 --- a/docs/content/guide/dev_guide.bootstrap.ngdoc +++ b/docs/content/guide/dev_guide.bootstrap.ngdoc @@ -38,7 +38,7 @@ Compatibility} doc. ## Creating Your Own Namespaces -When you are ready to define your own {@link api/angular.module.ng.$compileProvider.directive +When you are ready to define your own {@link guide/directive directive}, you may chose to create your own namespace in addition to specifying the Angular namespace. You use your own namespace to form the fully qualified name for directives that you create. diff --git a/docs/content/guide/dev_guide.compiler.ngdoc b/docs/content/guide/dev_guide.compiler.ngdoc index d979f309..f52928a6 100644 --- a/docs/content/guide/dev_guide.compiler.ngdoc +++ b/docs/content/guide/dev_guide.compiler.ngdoc @@ -3,7 +3,7 @@ @description The core of Angular is its HTML compiler. The compiler processes Angular -{@link api/angular.module.ng.$compileProvider.directive directives} allowing them to transform a +{@link guide/directive directives} allowing them to transform a static HTML page into a dynamic web application. The default HTML transformations that the Angular compiler provides are useful for building generic @@ -21,4 +21,4 @@ All compilation takes place in the web browser; no server is involved. ## Related API * {@link api/angular.module.ng.$compile Angular Compiler API} -* {@link api/angular.module.ng.$compileProvider.directive Directives API} +* {@link guide/directive Directives API} diff --git a/docs/content/guide/dev_guide.compiler.understanding_compiler.ngdoc b/docs/content/guide/dev_guide.compiler.understanding_compiler.ngdoc index 96c89d32..ea433cc5 100644 --- a/docs/content/guide/dev_guide.compiler.understanding_compiler.ngdoc +++ b/docs/content/guide/dev_guide.compiler.understanding_compiler.ngdoc @@ -3,7 +3,7 @@ @description The {@link api/angular.module.ng.$compile compiler} is responsible for applying -{@link api/angular.module.ng.$compileProvider.directive directives} to the HTML. The directives +{@link guide/directive directives} to the HTML. The directives extend the behavior of HTML elements and can effect the DOM structure, presentation, and behavior. This allows Angular to teach the browser new tricks. @@ -21,7 +21,7 @@ Since directives allow attachment of behavior to the HTML, the angular philosoph HTML as Domain Specific Language (DSL) when building an application. For example it may be useful to declare `TabPanel` directive, or `KeyboardShortcut` directive when for an application. -For details on how directives are created see {@link api/angular.module.ng.$compileProvider.directive +For details on how directives are created see {@link guide/directive directives} ## Related Topics diff --git a/docs/content/guide/dev_guide.forms.ngdoc b/docs/content/guide/dev_guide.forms.ngdoc index fe668ddf..6621e231 100644 --- a/docs/content/guide/dev_guide.forms.ngdoc +++ b/docs/content/guide/dev_guide.forms.ngdoc @@ -31,7 +31,7 @@ In addition it provides {@link api/angular.module.ng.$compileProvider.directive.
master = {{master | json}}
-\n') ) + + '\n'); + }); + } +}; + +exports.Example.prototype.toHtmlEmbed = function() { + var out = []; + out.push('
'); + out.push('
'); + return out.join(''); +}; + diff --git a/docs/src/gen-docs.js b/docs/src/gen-docs.js index 2c5857ec..dd9a015e 100755 --- a/docs/src/gen-docs.js +++ b/docs/src/gen-docs.js @@ -41,36 +41,35 @@ function writeTheRest(writesFuture) { var metadata = ngdoc.metadata(docs); writesFuture.push(writer.copyDir('img')); - writesFuture.push(writer.copyDir('examples')); var manifest = 'manifest="/build/docs/appcache.manifest"'; - writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index.html', + writesFuture.push(writer.copy('docs/src/templates/index.html', 'index.html', writer.replace, {'doc:manifest': ''})); //manifest //TODO(i): enable - writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index-nocache.html', + writesFuture.push(writer.copy('docs/src/templates/index.html', 'index-nocache.html', writer.replace, {'doc:manifest': ''})); - writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index-jq.html', + writesFuture.push(writer.copy('docs/src/templates/index.html', 'index-jq.html', writer.replace, {'doc:manifest': manifest})); - writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index-jq-nocache.html', + writesFuture.push(writer.copy('docs/src/templates/index.html', 'index-jq-nocache.html', writer.replace, {'doc:manifest': ''})); - writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index-debug.html', + writesFuture.push(writer.copy('docs/src/templates/index.html', 'index-debug.html', writer.replace, {'doc:manifest': ''})); - writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index-jq-debug.html', + writesFuture.push(writer.copy('docs/src/templates/index.html', 'index-jq-debug.html', writer.replace, {'doc:manifest': ''})); writesFuture.push(writer.copyTpl('offline.html')); writesFuture.push(writer.copyTpl('docs-scenario.html')); - writesFuture.push(writer.copyTpl('jquery.min.js')); - writesFuture.push(writer.copyTpl('jquery.js')); + writesFuture.push(writer.copyTpl('js/jquery.min.js')); + writesFuture.push(writer.copyTpl('js/jquery.js')); - writesFuture.push(writer.output('docs-keywords.js', + writesFuture.push(writer.output('js/docs-keywords.js', ['NG_PAGES=', JSON.stringify(metadata).replace(/{/g, '\n{'), ';'])); writesFuture.push(writer.output('sitemap.xml', new SiteMap(docs).render())); writesFuture.push(writer.output('docs-scenario.js', ngdoc.scenarios(docs))); @@ -78,19 +77,10 @@ function writeTheRest(writesFuture) { writesFuture.push(writer.output('appcache.manifest',appCache())); writesFuture.push(writer.copyTpl('.htaccess')); - writesFuture.push(writer.merge(['docs.js', - 'doc_widgets.js'], - 'docs-combined.js')); - writesFuture.push(writer.merge(['docs.css', - 'doc_widgets.css'], - 'docs-combined.css')); - writesFuture.push(writer.merge(['syntaxhighlighter/shCore.js', - 'syntaxhighlighter/shBrushJScript.js', - 'syntaxhighlighter/shBrushXml.js'], - 'syntaxhighlighter/syntaxhighlighter-combined.js')); - writesFuture.push(writer.merge(['syntaxhighlighter/shCore.css', - 'syntaxhighlighter/shThemeDefault.css'], - 'syntaxhighlighter/syntaxhighlighter-combined.css')); + writesFuture.push(writer.copy('docs/src/templates/js/docs.js', 'js/docs.js')); + + writesFuture.push(writer.copy('docs/src/templates/css/bootstrap.min.css', 'css/bootstrap.min.css')); + writesFuture.push(writer.copy('docs/src/templates/css/docs.css', 'css/docs.css')); } diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index 70411052..def665fa 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -5,7 +5,9 @@ var Showdown = require('../../lib/showdown').Showdown; var DOM = require('./dom.js').DOM; var htmlEscape = require('./dom.js').htmlEscape; +var Example = require('./example.js').Example; var NEW_LINE = /\n\r?/; +var globalID = 0; exports.trim = trim; exports.metadata = metadata; @@ -98,72 +100,85 @@ Doc.prototype = { if (!text) return text; var self = this, - IS_URL = /^(https?:\/\/|ftps?:\/\/|mailto:|\.|\/)/, - IS_ANGULAR = /^(api\/)?angular\./, - IS_HASH = /^#/, - parts = trim(text).split(/(
[\s\S]*?<\/pre>|[\s\S]*?<\/doc:\2>)/);
+      IS_URL = /^(https?:\/\/|ftps?:\/\/|mailto:|\.|\/)/,
+      IS_ANGULAR = /^(api\/)?angular\./,
+      IS_HASH = /^#/,
+      parts = trim(text).split(/(
[\s\S]*?<\/pre>|[\s\S]*?<\/doc:example>|]*>[\s\S]*?<\/example>)/),
+      seq = 0,
+      placeholderMap = {};
+
+    function placeholder(text) {
+      var id = 'REPLACEME' + (seq++);
+      placeholderMap[id] = text;
+      return id;
+    }
 
     parts.forEach(function(text, i) {
+      parts[i] = (text || '').
+        replace(/([\s\S]*?)<\/example>/gmi, function(_, module, deps, content) {
+          var example = new Example(self.scenarios);
 
-      function isDocWidget(name) {
-        if ((i + 1) % 3 != 2) return false;
-        if (name) return parts[i+1] == name;
-        return !!parts[i+1];
-      }
+          example.setModule(module);
+          example.addDeps(deps);
+          content.replace(/([\s\S]*?)<\/file>/gmi, function(_, name, content) {
+            example.addSource(name, content);
+          });
+          return placeholder(example.toHtml());
+        }).
+        replace(/^]*)?>([\s\S]*)<\/doc:example>/mi, function(_, attrs, content) {
+          var html, script, scenario,
+            example = new Example(self.scenarios);
 
-      // ignore each third item which is doc widget tag
-      if (!((i + 1) % 3)) {
-        parts[i] = '';
-        return;
-      }
+          example.setModule((attrs||'module=""').match(/^\s*module=["'](.*)["']\s*$/)[1]);
+          content.
+            replace(/]*)?>([\s\S]*)<\/doc:source>/mi, function(_, attrs, content) {
+              example.addSource('index.html', content.
+                replace(/';
+
+  return function(content) {
+    var prop = {
+          module: content.module,
+          html: '',
+          css: '',
+          script: ''
+        };
+
+    prop.head = templateMerge('', {url: angularUrls['angular.js']});
+
+    angular.forEach(content.html, function(file, index) {
+      if (index) {
+        prop.html += templateMerge(SCRIPT_CACHE, file);
+      } else {
+        prop.html += file.content;
+      }
+    });
+
+    angular.forEach(content.js, function(file, index) {
+      prop.script += file.content;
+    });
+
+    angular.forEach(content.css, function(file, index) {
+      prop.css += file.content;
+    });
+
+    formPostData("http://jsfiddle.net/api/post/library/pure/", {
+      title: 'AngularJS Example',
+      html: templateMerge(HTML, prop),
+      js: templateMerge(SCRIPT, prop),
+      css: templateMerge(CSS, prop)
+    });
+  };
+};
+
+
+
+docsApp.serviceFactory.sections = function sections() {
+  var sections = {
+    guide: [],
+    api: [],
+    tutorial: [],
+    misc: [],
+    cookbook: [],
+    getPage: function(sectionId, partialId) {
+      var pages = sections[sectionId];
+
+      partialId = partialId || 'index';
+
+      for (var i = 0, ii = pages.length; i < ii; i++) {
+        if (pages[i].id == partialId) {
+          return pages[i];
+        }
+      }
+      return null;
+    }
+  };
+
+  angular.forEach(NG_PAGES, function(page) {
+    page.url = page.section + '/' +  page.id;
+    if (page.id == 'angular.Module') {
+      page.partialUrl = 'partials/api/angular.IModule.html';
+    } else {
+      page.partialUrl = 'partials/' + page.url + '.html';
+    }
+
+    sections[page.section].push(page);
+  });
+
+  return sections;
+};
+
+
+docsApp.controller.DocsController = function($scope, $location, $window, $cookies, sections) {
+  var OFFLINE_COOKIE_NAME = 'ng-offline',
+      DOCS_PATH = /^\/(api)|(guide)|(cookbook)|(misc)|(tutorial)/,
+      INDEX_PATH = /^(\/|\/index[^\.]*.html)$/,
+      GLOBALS = /^angular\.([^\.]*)$/,
+      MODULE = /^angular\.module\.([^\.]*)$/,
+      MODULE_MOCK = /^angular\.mock\.([^\.]*)$/,
+      MODULE_DIRECTIVE = /^angular\.module\.([^\.]*)(?:\.\$compileProvider)?\.directive\.([^\.]*)$/,
+      MODULE_DIRECTIVE_INPUT = /^angular\.module\.([^\.]*)\.\$compileProvider\.directive\.input\.([^\.]*)$/,
+      MODULE_FILTER = /^angular\.module\.([^\.]*)\.\$?filter\.([^\.]*)$/,
+      MODULE_SERVICE = /^angular\.module\.([^\.]*)\.([^\.]*?)(Provider)?$/,
+      MODULE_TYPE = /^angular\.module\.([^\.]*)\..*\.([A-Z][^\.]*)$/,
+      URL = {
+        module: 'guide/module',
+        directive: 'guide/directive',
+        input: 'api/angular.module.ng.$compileProvider.directive.input',
+        filter: 'guide/dev_guide.templates.filters',
+        service: 'guide/dev_guide.services',
+        type: 'guide/types'
+      };
+
+
+  /**********************************
+   Publish methods
+   ***********************************/
+
+  $scope.navClass = function(page1, page2) {
+    return {
+      last: this.$position == 'last',
+      active: page1 && this.currentPage == page1 || page2 && this.currentPage == page2
+    };
+  }
+
+  $scope.submitForm = function() {
+    $scope.bestMatch && $location.path($scope.bestMatch.page.url);
+  };
+
+  $scope.afterPartialLoaded = function() {
+    var currentPageId = $location.path();
+    $scope.partialTitle = $scope.currentPage.shortName;
+    $window._gaq.push(['_trackPageview', currentPageId]);
+    loadDisqus(currentPageId);
+  };
+
+  /** stores a cookie that is used by apache to decide which manifest ot send */
+  $scope.enableOffline = function() {
+    //The cookie will be good for one year!
+    var date = new Date();
+    date.setTime(date.getTime()+(365*24*60*60*1000));
+    var expires = "; expires="+date.toGMTString();
+    var value = angular.version.full;
+    document.cookie = OFFLINE_COOKIE_NAME + "="+value+expires+"; path=" + $location.path;
+
+    //force the page to reload so server can serve new manifest file
+    window.location.reload(true);
+  };
+
+
+
+  /**********************************
+   Watches
+   ***********************************/
+
+  var SECTION_NAME = {
+    api: 'API Reference',
+    guide: 'Developer Guide',
+    misc: 'Miscellaneous',
+    tutorial: 'Tutorial',
+    cookbook: 'Examples'
+  };
+  $scope.$watch(function() {return $location.path(); }, function(path) {
+    // ignore non-doc links which are used in examples
+    if (DOCS_PATH.test(path)) {
+      var parts = path.split('/'),
+        sectionId = parts[1],
+        partialId = parts[2],
+        sectionName = SECTION_NAME[sectionId] || sectionId,
+        page = sections.getPage(sectionId, partialId);
+
+      $scope.currentPage = sections.getPage(sectionId, partialId);
+
+      if (!$scope.currentPage) {
+        $scope.partialTitle = 'Error: Page Not Found!';
+      }
+
+      updateSearch();
+
+
+      // Update breadcrumbs
+      var breadcrumb = $scope.breadcrumb = [],
+        match;
+
+      if (partialId) {
+        breadcrumb.push({ name: sectionName, url: sectionId });
+        if (partialId == 'angular.Module') {
+          breadcrumb.push({ name: 'angular.Module' });
+        } else if (match = partialId.match(GLOBALS)) {
+          breadcrumb.push({ name: partialId });
+        } else if (match = partialId.match(MODULE)) {
+          breadcrumb.push({ name: match[1] });
+        } else if (match = partialId.match(MODULE_SERVICE)) {
+          breadcrumb.push({ name: match[1], url: sectionId + '/angular.module.' + match[1] });
+          breadcrumb.push({ name: match[2] });
+        } else if (match = partialId.match(MODULE_FILTER)) {
+          breadcrumb.push({ name: match[1], url: sectionId + '/angular.module.' + match[1] });
+          breadcrumb.push({ name: match[2] });
+        } else if (match = partialId.match(MODULE_DIRECTIVE)) {
+          breadcrumb.push({ name: match[1], url: sectionId + '/angular.module.' + match[1] });
+          breadcrumb.push({ name: match[2] });
+        } else if (match = partialId.match(MODULE_DIRECTIVE_INPUT)) {
+          breadcrumb.push({ name: match[1], url: sectionId + '/angular.module.' + match[1] });
+          breadcrumb.push({ name: 'input', url: URL.input });
+          breadcrumb.push({ name: match[2] });
+        } else if (match = partialId.match(MODULE_TYPE)) {
+          breadcrumb.push({ name: match[1], url: sectionId + '/angular.module.' + match[1] });
+          breadcrumb.push({ name: match[2] });
+        } else if (match = partialId.match(MODULE_MOCK)) {
+          breadcrumb.push({ name: 'angular.mock.' + match[1] });
+        } else {
+          breadcrumb.push({ name: page.shortName });
+        }
+      } else {
+        breadcrumb.push({ name: sectionName });
+      }
+    }
+  });
+
+  $scope.$watch('search', updateSearch);
+
+
+
+  /**********************************
+   Initialize
+   ***********************************/
+
+  $scope.versionNumber = angular.version.full;
+  $scope.version = angular.version.full + "  " + angular.version.codeName;
+  $scope.subpage = false;
+  $scope.offlineEnabled = ($cookies[OFFLINE_COOKIE_NAME] == angular.version.full);
+  $scope.futurePartialTitle = null;
+  $scope.loading = 0;
+  $scope.URL = URL;
+  $scope.$cookies = $cookies;
+
+  $cookies.platformPreference = $cookies.platformPreference || 'gitUnix';
+
+  if (!$location.path() || INDEX_PATH.test($location.path())) {
+    $location.path('/api').replace();
+  }
+  // bind escape to hash reset callback
+  angular.element(window).bind('keydown', function(e) {
+    if (e.keyCode === 27) {
+      $scope.$apply(function() {
+        $scope.subpage = false;
+      });
+    }
+  });
+
+  /**********************************
+   Private methods
+   ***********************************/
+
+  function updateSearch() {
+    var cache = {},
+        pages = sections[$location.path().split('/')[1]],
+        modules = $scope.modules = [],
+        otherPages = $scope.pages = [],
+        search = $scope.search,
+        bestMatch = {page: null, rank:0};
+
+    angular.forEach(pages, function(page) {
+      var match,
+        id = page.id;
+
+      if (!(match = rank(page, search))) return;
+
+      if (match.rank > bestMatch.rank) {
+        bestMatch = match;
+      }
+
+      if (id == 'angular.Module') {
+        module('ng').types.push(page);
+      } else if (match = id.match(GLOBALS)) {
+        module('ng').globals.push(page);
+      } else if (match = id.match(MODULE)) {
+        module(match[1]);
+      } else if (match = id.match(MODULE_SERVICE)) {
+        module(match[1]).service(match[2])[match[3] ? 'provider' : 'instance'] = page;
+      } else if (match = id.match(MODULE_FILTER)) {
+        module(match[1]).filters.push(page);
+      } else if (match = id.match(MODULE_DIRECTIVE)) {
+        module(match[1]).directives.push(page);
+      } else if (match = id.match(MODULE_DIRECTIVE_INPUT)) {
+        module(match[1]).directives.push(page);
+      } else if (match = id.match(MODULE_TYPE)) {
+        module(match[1]).types.push(page);
+      } else if (match = id.match(MODULE_MOCK)) {
+        module('ngMock').globals.push(page);
+      } else if (page.section != 'api' && page.id != 'index'){
+        otherPages.push(page);
+      }
+
+    });
+
+    $scope.bestMatch = bestMatch;
+
+    /*************/
+
+    function module(name) {
+      var module = cache[name];
+      if (!module) {
+        module = cache[name] = {
+          name: name,
+          url: 'api/angular.module.' + name,
+          globals: [],
+          directives: [],
+          services: [],
+          service: function(name) {
+            var service =  cache[this.name + ':' + name];
+            if (!service) {
+              service = {name: name};
+              cache[this.name + ':' + name] = service;
+              this.services.push(service);
+            }
+            return service;
+          },
+          types: [],
+          filters: []
+        }
+        modules.push(module);
+      }
+      return module;
+    }
+
+    function rank(page, terms) {
+      var ranking = {page: page, rank:0},
+        keywords = page.keywords,
+        title = page.shortName.toLowerCase();
+
+      terms && angular.forEach(terms.toLowerCase().split(' '), function(term) {
+        var index;
+
+        if (ranking) {
+          if (keywords.indexOf(term) == -1) {
+            ranking = null;
+          } else {
+            ranking.rank ++; // one point for each term found
+            if ((index = title.indexOf(term)) != -1) {
+              ranking.rank += 20 - index; // ten points if you match title
+            }
+          }
+        }
+      });
+      return ranking;
+    }
+  }
+
+
+  function loadDisqus(currentPageId) {
+    // http://docs.disqus.com/help/2/
+    window.disqus_shortname = 'angularjs-next';
+    window.disqus_identifier = currentPageId;
+    window.disqus_url = 'http://docs.angularjs.org' + currentPageId;
+
+    if ($location.host() == 'localhost') {
+      return; // don't display disqus on localhost, comment this out if needed
+      //window.disqus_developer = 1;
+    }
+
+    // http://docs.disqus.com/developers/universal/
+    (function() {
+      var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
+      dsq.src = 'http://angularjs.disqus.com/embed.js';
+      (document.getElementsByTagName('head')[0] ||
+        document.getElementsByTagName('body')[0]).appendChild(dsq);
+    })();
+
+    angular.element(document.getElementById('disqus_thread')).html('');
+  }
+}
+
+
+angular.module('docsApp', ['ngResource', 'ngCookies', 'ngSanitize', 'bootstrap', 'bootstrapPrettify']).
+  config(function($locationProvider) {
+    $locationProvider.html5Mode(true).hashPrefix('!');
+  }).
+  factory(docsApp.serviceFactory).
+  directive(docsApp.directive).
+  controller(docsApp.controller);
diff --git a/docs/src/templates/js/jquery.js b/docs/src/templates/js/jquery.js
new file mode 120000
index 00000000..557f2716
--- /dev/null
+++ b/docs/src/templates/js/jquery.js
@@ -0,0 +1 @@
+../../../../lib/jquery/jquery.js
\ No newline at end of file
diff --git a/docs/src/templates/js/jquery.min.js b/docs/src/templates/js/jquery.min.js
new file mode 120000
index 00000000..3bb8805c
--- /dev/null
+++ b/docs/src/templates/js/jquery.min.js
@@ -0,0 +1 @@
+../../../../lib/jquery/jquery.min.js
\ No newline at end of file
diff --git a/docs/src/templates/syntaxhighlighter/shBrushJScript.js b/docs/src/templates/syntaxhighlighter/shBrushJScript.js
deleted file mode 100644
index d52a77b2..00000000
--- a/docs/src/templates/syntaxhighlighter/shBrushJScript.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * SyntaxHighlighter
- * http://alexgorbatchev.com/SyntaxHighlighter
- *
- * SyntaxHighlighter is donationware. If you are using it, please donate.
- * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
- *
- * @version
- * 3.0.83 (July 02 2010)
- *
- * @copyright
- * Copyright (C) 2004-2010 Alex Gorbatchev.
- *
- * @license
- * Dual licensed under the MIT and GPL licenses.
- */
-;(function()
-{
-	// CommonJS
-	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
-
-	function Brush()
-	{
-		var keywords =	'break case catch continue ' +
-						'default delete do else false  ' +
-						'for function if in instanceof ' +
-						'new null return super switch ' +
-						'this throw true try typeof var while with'
-						;
-
-		var r = SyntaxHighlighter.regexLib;
-
-		this.regexList = [
-			{ regex: r.multiLineDoubleQuotedString,					css: 'string' },			// double quoted strings
-			{ regex: r.multiLineSingleQuotedString,					css: 'string' },			// single quoted strings
-			{ regex: r.singleLineCComments,							css: 'comments' },			// one line comments
-			{ regex: r.multiLineCComments,							css: 'comments' },			// multiline comments
-			{ regex: /\s*#.*/gm,									css: 'preprocessor' },		// preprocessor tags like #region and #endregion
-			{ regex: new RegExp(this.getKeywords(keywords), 'gm'),	css: 'keyword' }			// keywords
-			];
-
-		this.forHtmlScript(r.scriptScriptTags);
-	};
-
-	Brush.prototype	= new SyntaxHighlighter.Highlighter();
-	Brush.aliases	= ['js', 'jscript', 'javascript'];
-
-	SyntaxHighlighter.brushes.JScript = Brush;
-
-	// CommonJS
-	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
-})();
diff --git a/docs/src/templates/syntaxhighlighter/shBrushXml.js b/docs/src/templates/syntaxhighlighter/shBrushXml.js
deleted file mode 100644
index ac879949..00000000
--- a/docs/src/templates/syntaxhighlighter/shBrushXml.js
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * SyntaxHighlighter
- * http://alexgorbatchev.com/SyntaxHighlighter
- *
- * SyntaxHighlighter is donationware. If you are using it, please donate.
- * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
- *
- * @version
- * 3.0.83 (July 02 2010)
- *
- * @copyright
- * Copyright (C) 2004-2010 Alex Gorbatchev.
- *
- * @license
- * Dual licensed under the MIT and GPL licenses.
- */
-;(function()
-{
-	// CommonJS
-	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
-
-	function Brush()
-	{
-		function process(match, regexInfo)
-		{
-			var constructor = SyntaxHighlighter.Match,
-				code = match[0],
-				tag = new XRegExp('(<|<)[\\s\\/\\?]*(?[:\\w-\\.]+)', 'xg').exec(code),
-				result = []
-				;
-
-			if (match.attributes != null)
-			{
-				var attributes,
-					regex = new XRegExp('(? [\\w:\\-\\.]+)' +
-										'\\s*=\\s*' +
-										'(? ".*?"|\'.*?\'|\\w+)',
-										'xg');
-
-				while ((attributes = regex.exec(code)) != null)
-				{
-					result.push(new constructor(attributes.name, match.index + attributes.index, 'color1'));
-					result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string'));
-				}
-			}
-
-			if (tag != null)
-				result.push(
-					new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword')
-				);
-
-			return result;
-		}
-
-		this.regexList = [
-			{ regex: new XRegExp('(\\<|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\>|>)', 'gm'),			css: 'color2' },	// 
-			{ regex: SyntaxHighlighter.regexLib.xmlComments,												css: 'comments' },	// 
-			{ regex: new XRegExp('(<|<)[\\s\\/\\?]*(\\w+)(?.*?)[\\s\\/\\?]*(>|>)', 'sg'), func: process }
-		];
-	};
-
-	Brush.prototype	= new SyntaxHighlighter.Highlighter();
-	Brush.aliases	= ['xml', 'xhtml', 'xslt', 'html'];
-
-	SyntaxHighlighter.brushes.Xml = Brush;
-
-	// CommonJS
-	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
-})();
diff --git a/docs/src/templates/syntaxhighlighter/shCore.css b/docs/src/templates/syntaxhighlighter/shCore.css
deleted file mode 100644
index 4f0021e2..00000000
--- a/docs/src/templates/syntaxhighlighter/shCore.css
+++ /dev/null
@@ -1,226 +0,0 @@
-/**
- * SyntaxHighlighter
- * http://alexgorbatchev.com/SyntaxHighlighter
- *
- * SyntaxHighlighter is donationware. If you are using it, please donate.
- * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
- *
- * @version
- * 3.0.83 (July 02 2010)
- *
- * @copyright
- * Copyright (C) 2004-2010 Alex Gorbatchev.
- *
- * @license
- * Dual licensed under the MIT and GPL licenses.
- */
-.syntaxhighlighter a,
-.syntaxhighlighter div,
-.syntaxhighlighter code,
-.syntaxhighlighter table,
-.syntaxhighlighter table td,
-.syntaxhighlighter table tr,
-.syntaxhighlighter table tbody,
-.syntaxhighlighter table thead,
-.syntaxhighlighter table caption,
-.syntaxhighlighter textarea {
-  -moz-border-radius: 0 0 0 0 !important;
-  -webkit-border-radius: 0 0 0 0 !important;
-  background: none !important;
-  border: 0 !important;
-  bottom: auto !important;
-  float: none !important;
-  height: auto !important;
-  left: auto !important;
-  line-height: 1.1em !important;
-  margin: 0 !important;
-  outline: 0 !important;
-  overflow: visible !important;
-  padding: 0 !important;
-  position: static !important;
-  right: auto !important;
-  text-align: left !important;
-  top: auto !important;
-  vertical-align: baseline !important;
-  width: auto !important;
-  box-sizing: content-box !important;
-  font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
-  font-weight: normal !important;
-  font-style: normal !important;
-  font-size: 1em !important;
-  min-height: inherit !important;
-  min-height: auto !important;
-}
-
-.syntaxhighlighter {
-  width: 100% !important;
-  margin: 1em 0 1em 0 !important;
-  position: relative !important;
-  overflow: auto !important;
-  font-size: 1em !important;
-}
-.syntaxhighlighter.source {
-  overflow: hidden !important;
-}
-.syntaxhighlighter .bold {
-  font-weight: bold !important;
-}
-.syntaxhighlighter .italic {
-  font-style: italic !important;
-}
-.syntaxhighlighter .line {
-  white-space: pre !important;
-}
-.syntaxhighlighter table {
-  width: 100% !important;
-}
-.syntaxhighlighter table caption {
-  text-align: left !important;
-  padding: .5em 0 0.5em 1em !important;
-}
-.syntaxhighlighter table td.code {
-  width: 100% !important;
-}
-.syntaxhighlighter table td.code .container {
-  position: relative !important;
-}
-.syntaxhighlighter table td.code .container textarea {
-  box-sizing: border-box !important;
-  position: absolute !important;
-  left: 0 !important;
-  top: 0 !important;
-  width: 100% !important;
-  height: 100% !important;
-  border: none !important;
-  background: white !important;
-  padding-left: 1em !important;
-  overflow: hidden !important;
-  white-space: pre !important;
-}
-.syntaxhighlighter table td.gutter .line {
-  text-align: right !important;
-  padding: 0 0.5em 0 1em !important;
-}
-.syntaxhighlighter table td.code .line {
-  padding: 0 1em !important;
-}
-.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
-  padding-left: 0em !important;
-}
-.syntaxhighlighter.show {
-  display: block !important;
-}
-.syntaxhighlighter.collapsed table {
-  display: none !important;
-}
-.syntaxhighlighter.collapsed .toolbar {
-  padding: 0.1em 0.8em 0em 0.8em !important;
-  font-size: 1em !important;
-  position: static !important;
-  width: auto !important;
-  height: auto !important;
-}
-.syntaxhighlighter.collapsed .toolbar span {
-  display: inline !important;
-  margin-right: 1em !important;
-}
-.syntaxhighlighter.collapsed .toolbar span a {
-  padding: 0 !important;
-  display: none !important;
-}
-.syntaxhighlighter.collapsed .toolbar span a.expandSource {
-  display: inline !important;
-}
-.syntaxhighlighter .toolbar {
-  position: absolute !important;
-  right: 1px !important;
-  top: 1px !important;
-  width: 11px !important;
-  height: 11px !important;
-  font-size: 10px !important;
-  z-index: 10 !important;
-}
-.syntaxhighlighter .toolbar span.title {
-  display: inline !important;
-}
-.syntaxhighlighter .toolbar a {
-  display: block !important;
-  text-align: center !important;
-  text-decoration: none !important;
-  padding-top: 1px !important;
-}
-.syntaxhighlighter .toolbar a.expandSource {
-  display: none !important;
-}
-.syntaxhighlighter.ie {
-  font-size: .9em !important;
-  padding: 1px 0 1px 0 !important;
-}
-.syntaxhighlighter.ie .toolbar {
-  line-height: 8px !important;
-}
-.syntaxhighlighter.ie .toolbar a {
-  padding-top: 0px !important;
-}
-.syntaxhighlighter.printing .line.alt1 .content,
-.syntaxhighlighter.printing .line.alt2 .content,
-.syntaxhighlighter.printing .line.highlighted .number,
-.syntaxhighlighter.printing .line.highlighted.alt1 .content,
-.syntaxhighlighter.printing .line.highlighted.alt2 .content {
-  background: none !important;
-}
-.syntaxhighlighter.printing .line .number {
-  color: #bbbbbb !important;
-}
-.syntaxhighlighter.printing .line .content {
-  color: black !important;
-}
-.syntaxhighlighter.printing .toolbar {
-  display: none !important;
-}
-.syntaxhighlighter.printing a {
-  text-decoration: none !important;
-}
-.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
-  color: black !important;
-}
-.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
-  color: #008200 !important;
-}
-.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
-  color: blue !important;
-}
-.syntaxhighlighter.printing .keyword {
-  color: #006699 !important;
-  font-weight: bold !important;
-}
-.syntaxhighlighter.printing .preprocessor {
-  color: gray !important;
-}
-.syntaxhighlighter.printing .variable {
-  color: #aa7700 !important;
-}
-.syntaxhighlighter.printing .value {
-  color: #009900 !important;
-}
-.syntaxhighlighter.printing .functions {
-  color: #ff1493 !important;
-}
-.syntaxhighlighter.printing .constants {
-  color: #0066cc !important;
-}
-.syntaxhighlighter.printing .script {
-  font-weight: bold !important;
-}
-.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
-  color: gray !important;
-}
-.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
-  color: #ff1493 !important;
-}
-.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
-  color: red !important;
-}
-.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
-  color: black !important;
-}
diff --git a/docs/src/templates/syntaxhighlighter/shCore.js b/docs/src/templates/syntaxhighlighter/shCore.js
deleted file mode 100644
index 21d52a28..00000000
--- a/docs/src/templates/syntaxhighlighter/shCore.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * SyntaxHighlighter
- * http://alexgorbatchev.com/SyntaxHighlighter
- *
- * SyntaxHighlighter is donationware. If you are using it, please donate.
- * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
- *
- * @version
- * 3.0.83 (July 02 2010)
- *
- * @copyright
- * Copyright (C) 2004-2010 Alex Gorbatchev.
- *
- * @license
- * Dual licensed under the MIT and GPL licenses.
- */
-eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function() {return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('K M;I(M)1S 2U("2a\'t 4k M 4K 2g 3l 4G 4H");(6() {6 r(f,e){I(!M.1R(f))1S 3m("3s 15 4R");K a=f.1w;f=M(f.1m,t(f)+(e||""));I(a)f.1w={1m:a.1m,19:a.19?a.19.1a(0):N};H f}6 t(f){H(f.1J?"g":"")+(f.4s?"i":"")+(f.4p?"m":"")+(f.4v?"x":"")+(f.3n?"y":"")}6 B(f,e,a,b){K c=u.L,d,h,g;v=R;5K{O(;c--;){g=u[c];I(a&g.3r&&(!g.2p||g.2p.W(b))){g.2q.12=e;I((h=g.2q.X(f))&&h.P===e){d={3k:g.2b.W(b,h,a),1C:h};1N}}}}5v(i){1S i}5q{v=11}H d}6 p(f,e,a){I(3b.Z.1i)H f.1i(e,a);O(a=a||0;a-1},3d:6(g){e+=g}};c1&&p(e,"")>-1){a=15(J.1m,n.Q.W(t(J),"g",""));n.Q.W(f.1a(e.P),a,6() {O(K c=1;c<14.L-2;c++)I(14[c]===1d)e[c]=1d})}I(J.1w&&J.1w.19)O(K b=1;be.P&&J.12--}H e};I(!D)15.Z.1A=6(f){(f=n.X.W(J,f))&&J.1J&&!f[0].L&&J.12>f.P&&J.12--;H!!f};1r.Z.1C=6(f){M.1R(f)||(f=15(f));I(f.1J){K e=n.1C.1p(J,14);f.12=0;H e}H f.X(J)};1r.Z.Q=6(f,e){K a=M.1R(f),b,c;I(a&&1j e.58()==="3f"&&e.1i("${")===-1&&y)H n.Q.1p(J,14);I(a){I(f.1w)b=f.1w.19}Y f+="";I(1j e==="6")c=n.Q.W(J,f,6() {I(b){14[0]=1f 1r(14[0]);O(K d=0;dd.L-3;){i=1r.Z.1a.W(g,-1)+i;g=1Q.3i(g/10)}H(g?d[g]||"":"$")+i}Y{g=+i;I(g<=d.L-3)H d[g];g=b?p(b,i):-1;H g>-1?d[g+1]:h}})})}I(a&&f.1J)f.12=0;H c};1r.Z.1e=6(f,e){I(!M.1R(f))H n.1e.1p(J,14);K a=J+"",b=[],c=0,d,h;I(e===1d||+e<0)e=5D;Y{e=1Q.3i(+e);I(!e)H[]}O(f=M.3c(f);d=f.X(a);){I(f.12>c){b.U(a.1a(c,d.P));d.L>1&&d.P=e)1N}f.12===d.P&&f.12++}I(c===a.L){I(!n.1A.W(f,"")||h)b.U("")}Y b.U(a.1a(c));H b.L>e?b.1a(0,e):b};M.1h(/\\(\\?#[^)]*\\)/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"});M.1h(/\\((?!\\?)/,6() {J.19.U(N);H"("});M.1h(/\\(\\?<([$\\w]+)>/,6(f){J.19.U(f[1]);J.2N=R;H"("});M.1h(/\\\\k<([\\w$]+)>/,6(f){K e=p(J.19,f[1]);H e>-1?"\\\\"+(e+1)+(3R(f.2S.3a(f.P+f[0].L))?"":"(?:)"):f[0]});M.1h(/\\[\\^?]/,6(f){H f[0]==="[]"?"\\\\b\\\\B":"[\\\\s\\\\S]"});M.1h(/^\\(\\?([5A]+)\\)/,6(f){J.3d(f[1]);H""});M.1h(/(?:\\s+|#.*)+/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"},M.1B,6() {H J.2K("x")});M.1h(/\\./,6() {H"[\\\\s\\\\S]"},M.1B,6() {H J.2K("s")})})();1j 2e!="1d"&&(2e.M=M);K 1v=6() {6 r(a,b){a.1l.1i(b)!=-1||(a.1l+=" "+b)}6 t(a){H a.1i("3e")==0?a:"3e"+a}6 B(a){H e.1Y.2A[t(a)]}6 p(a,b,c){I(a==N)H N;K d=c!=R?a.3G:[a.2G],h={"#":"1c",".":"1l"}[b.1o(0,1)]||"3h",g,i;g=h!="3h"?b.1o(1):b.5u();I((a[h]||"").1i(g)!=-1)H a;O(a=0;d&&a\'+c+""});H a}6 n(a,b){a.1e("\\n");O(K c="",d=0;d<50;d++)c+="                    ";H a=v(a,6(h){I(h.1i("\\t")==-1)H h;O(K g=0;(g=h.1i("\\t"))!=-1;)h=h.1o(0,g)+c.1o(0,b-g%b)+h.1o(g+1,h.L);H h})}6 x(a){H a.Q(/^\\s+|\\s+$/g,"")}6 D(a,b){I(a.Pb.P)H 1;Y I(a.Lb.L)H 1;H 0}6 y(a,b){6 c(k){H k[0]}O(K d=N,h=[],g=b.2D?b.2D:c;(d=b.1I.X(a))!=N;){K i=g(d,b);I(1j i=="3f")i=[1f e.2L(i,d.P,b.23)];h=h.1O(i)}H h}6 E(a){K b=/(.*)((&1G;|&1y;).*)/;H a.Q(e.3A.3M,6(c){K d="",h=N;I(h=b.X(c)){c=h[1];d=h[2]}H\'\'+c+""+d})}6 z() {O(K a=1E.36("1k"),b=[],c=0;c<1z 4I="1Z://2y.3L.3K/4L/5L"><3J><4N 1Z-4M="5G-5M" 6K="2O/1z; 6J=6I-8" /><1t>6L 1v<3B 1L="25-6M:6Q,6P,6O,6N-6F;6y-2f:#6x;2f:#6w;25-22:6v;2O-3D:3C;">1v3v 3.0.76 (72 73 3x)1Z://3u.2w/1v70 17 6U 71.6T 6X-3x 6Y 6D.6t 61 60 J 1k, 5Z 5R 5V <2R/>5U 5T 5S!\'}},1Y:{2j:N,2A:{}},1U:{},3A:{6n:/\\/\\*[\\s\\S]*?\\*\\//2c,6m:/\\/\\/.*$/2c,6l:/#.*$/2c,6k:/"([^\\\\"\\n]|\\\\.)*"/g,6o:/\'([^\\\\\'\\n]|\\\\.)*\'/g,6p:1f M(\'"([^\\\\\\\\"]|\\\\\\\\.)*"\',"3z"),6s:1f M("\'([^\\\\\\\\\']|\\\\\\\\.)*\'","3z"),6q:/(&1y;|<)!--[\\s\\S]*?--(&1G;|>)/2c,3M:/\\w+:\\/\\/[\\w-.\\/?%&=:@;]*/g,6a:{18:/(&1y;|<)\\?=?/g,1b:/\\?(&1G;|>)/g},69:{18:/(&1y;|<)%=?/g,1b:/%(&1G;|>)/g},6d:{18:/(&1y;|<)\\s*1k.*?(&1G;|>)/2T,1b:/(&1y;|<)\\/\\s*1k\\s*(&1G;|>)/2T}},16:{1H:6(a){6 b(i,k){H e.16.2o(i,k,e.13.1x[k])}O(K c=\'\',d=e.16.2x,h=d.2X,g=0;g";H c},2o:6(a,b,c){H\'<2W>\'+c+""},2b:6(a){K b=a.1F,c=b.1l||"";b=B(p(b,".20",R).1c);K d=6(h){H(h=15(h+"6f(\\\\w+)").X(c))?h[1]:N}("6g");b&&d&&e.16.2x[d].2B(b);a.3N()},2x:{2X:["21","2P"],21:{1H:6(a){I(a.V("2l")!=R)H"";K b=a.V("1t");H e.16.2o(a,"21",b?b:e.13.1x.21)},2B:6(a){a=1E.6j(t(a.1c));a.1l=a.1l.Q("47","")}},2P:{2B:6() {K a="68=0";a+=", 18="+(31.30-33)/2+", 32="+(31.2Z-2Y)/2+", 30=33, 2Z=2Y";a=a.Q(/^,/,"");a=1P.6Z("","38",a);a.2C();K b=a.1E;b.6W(e.13.1x.37);b.6V();a.2C()}}}},35:6(a,b){K c;I(b)c=[b];Y{c=1E.36(e.13.34);O(K d=[],h=0;h(.*?))\\\\]$"),s=1f M("(?<27>[\\\\w-]+)\\\\s*:\\\\s*(?<1T>[\\\\w-%#]+|\\\\[.*?\\\\]|\\".*?\\"|\'.*?\')\\\\s*;?","g");(j=s.X(k))!=N;){K o=j.1T.Q(/^[\'"]|[\'"]$/g,"");I(o!=N&&m.1A(o)){o=m.X(o);o=o.2V.L>0?o.2V.1e(/\\s*,\\s*/):[]}l[j.27]=o}g={1F:g,1n:C(i,l)};g.1n.1D!=N&&d.U(g)}H d},1M:6(a,b){K c=J.35(a,b),d=N,h=e.13;I(c.L!==0)O(K g=0;g")==o-3){m=m.4h(0,o-3);s=R}l=s?m:l}I((i.1t||"")!="")k.1t=i.1t;k.1D=j;d.2Q(k);b=d.2F(l);I((i.1c||"")!="")b.1c=i.1c;i.2G.74(b,i)}}},2E:6(a){w(1P,"4k",6() {e.1M(a)})}};e.2E=e.2E;e.1M=e.1M;e.2L=6(a,b,c){J.1T=a;J.P=b;J.L=a.L;J.23=c;J.1V=N};e.2L.Z.1q=6() {H J.1T};e.4l=6(a){6 b(j,l){O(K m=0;md)1N;Y I(g.P==c.P&&g.L>c.L)a[b]=N;Y I(g.P>=c.P&&g.P\'+c+""},3Q:6(a,b){K c="",d=a.1e("\\n").L,h=2u(J.V("2i-1s")),g=J.V("2z-1s-2t");I(g==R)g=(h+d-1).1q().L;Y I(3R(g)==R)g=0;O(K i=0;i\'+j+"":"")+i)}H a},4f:6(a){H a?"<4a>"+a+"":""},4b:6(a,b){6 c(l){H(l=l?l.1V||g:g)?l+" ":""}O(K d=0,h="",g=J.V("1D",""),i=0;i|&1y;2R\\s*\\/?&1G;/2T;I(e.13.46==R)b=b.Q(h,"\\n");I(e.13.44==R)b=b.Q(h,"");b=b.1e("\\n");h=/^\\s*/;g=4Q;O(K i=0;i0;i++){K k=b[i];I(x(k).L!=0){k=h.X(k);I(k==N){a=a;1N a}g=1Q.4q(k[0].L,g)}}I(g>0)O(i=0;i\'+(J.V("16")?e.16.1H(J):"")+\'<3Z 5z="0" 5H="0" 5J="0">\'+J.4f(J.V("1t"))+"<3T><3P>"+(1u?\'<2d 1g="1u">\'+J.3Q(a)+"":"")+\'<2d 1g="17">\'+b+""},2F:6(a){I(a===N)a="";J.17=a;K b=J.3Y("T");b.3X=J.1H(a);J.V("16")&&w(p(b,".16"),"5c",e.16.2b);J.V("3V-17")&&w(p(b,".17"),"56",f);H b},2Q:6(a){J.1c=""+1Q.5d(1Q.5n()*5k).1q();e.1Y.2A[t(J.1c)]=J;J.1n=C(e.2v,a||{});I(J.V("2k")==R)J.1n.16=J.1n.1u=11},5j:6(a){a=a.Q(/^\\s+|\\s+$/g,"").Q(/\\s+/g,"|");H"\\\\b(?:"+a+")\\\\b"},5f:6(a){J.28={18:{1I:a.18,23:"1k"},1b:{1I:a.1b,23:"1k"},17:1f M("(?<18>"+a.18.1m+")(?<17>.*?)(?<1b>"+a.1b.1m+")","5o")}}};H e}();1j 2e!="1d"&&(2e.1v=1v);',62,441,'||||||function|||||||||||||||||||||||||||||||||||||return|if|this|var|length|XRegExp|null|for|index|replace|true||div|push|getParam|call|exec|else|prototype||false|lastIndex|config|arguments|RegExp|toolbar|code|left|captureNames|slice|right|id|undefined|split|new|class|addToken|indexOf|typeof|script|className|source|params|substr|apply|toString|String|line|title|gutter|SyntaxHighlighter|_xregexp|strings|lt|html|test|OUTSIDE_CLASS|match|brush|document|target|gt|getHtml|regex|global|join|style|highlight|break|concat|window|Math|isRegExp|throw|value|brushes|brushName|space|alert|vars|http|syntaxhighlighter|expandSource|size|css|case|font|Fa|name|htmlScript|dA|can|handler|gm|td|exports|color|in|href|first|discoveredBrushes|light|collapse|object|cache|getButtonHtml|trigger|pattern|getLineHtml|nbsp|numbers|parseInt|defaults|com|items|www|pad|highlighters|execute|focus|func|all|getDiv|parentNode|navigator|INSIDE_CLASS|regexList|hasFlag|Match|useScriptTags|hasNamedCapture|text|help|init|br|input|gi|Error|values|span|list|250|height|width|screen|top|500|tagName|findElements|getElementsByTagName|aboutDialog|_blank|appendChild|charAt|Array|copyAsGlobal|setFlag|highlighter_|string|attachEvent|nodeName|floor|backref|output|the|TypeError|sticky|Za|iterate|freezeTokens|scope|type|textarea|alexgorbatchev|version|margin|2010|005896|gs|regexLib|body|center|align|noBrush|require|childNodes|DTD|xhtml1|head|org|w3|url|preventDefault|container|tr|getLineNumbersHtml|isNaN|userAgent|tbody|isLineHighlighted|quick|void|innerHTML|create|table|links|auto|smart|tab|stripBrs|tabs|bloggerMode|collapsed|plain|getCodeLinesHtml|caption|getMatchesHtml|findMatches|figureOutLineNumbers|removeNestedMatches|getTitleHtml|brushNotHtmlScript|substring|createElement|Highlighter|load|HtmlScript|Brush|pre|expand|multiline|min|Can|ignoreCase|find|blur|extended|toLowerCase|aliases|addEventListener|innerText|textContent|wasn|select|createTextNode|removeChild|option|same|frame|xmlns|dtd|twice|1999|equiv|meta|htmlscript|transitional|1E3|expected|PUBLIC|DOCTYPE|on|W3C|XHTML|TR|EN|Transitional||configured|srcElement|Object|after|run|dblclick|matchChain|valueOf|constructor|default|switch|click|round|execAt|forHtmlScript|token|gimy|functions|getKeywords|1E6|escape|within|random|sgi|another|finally|supply|MSIE|ie|toUpperCase|catch|returnValue|definition|event|border|imsx|constructing|one|Infinity|from|when|Content|cellpadding|flags|cellspacing|try|xhtml|Type|spaces|2930402|hosted_button_id|lastIndexOf|donate|active|development|keep|to|xclick|_s|Xml|please|like|you|paypal|cgi|cmd|webscr|bin|highlighted|scrollbars|aspScriptTags|phpScriptTags|sort|max|scriptScriptTags|toolbar_item|_|command|command_|number|getElementById|doubleQuotedString|singleLinePerlComments|singleLineCComments|multiLineCComments|singleQuotedString|multiLineDoubleQuotedString|xmlComments|alt|multiLineSingleQuotedString|If|https|1em|000|fff|background|5em|xx|bottom|75em|Gorbatchev|large|serif|CDATA|continue|utf|charset|content|About|family|sans|Helvetica|Arial|Geneva|3em|nogutter|Copyright|syntax|close|write|2004|Alex|open|JavaScript|highlighter|July|02|replaceChild|offset|83'.split('|'),0,{}))
diff --git a/docs/src/templates/syntaxhighlighter/shThemeDefault.css b/docs/src/templates/syntaxhighlighter/shThemeDefault.css
deleted file mode 100644
index 8a870e4e..00000000
--- a/docs/src/templates/syntaxhighlighter/shThemeDefault.css
+++ /dev/null
@@ -1,117 +0,0 @@
-/**
- * SyntaxHighlighter
- * http://alexgorbatchev.com/SyntaxHighlighter
- *
- * SyntaxHighlighter is donationware. If you are using it, please donate.
- * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
- *
- * @version
- * 3.0.83 (July 02 2010)
- *
- * @copyright
- * Copyright (C) 2004-2010 Alex Gorbatchev.
- *
- * @license
- * Dual licensed under the MIT and GPL licenses.
- */
-.syntaxhighlighter {
-  background-color: white !important;
-}
-.syntaxhighlighter .line.alt1 {
-  background-color: white !important;
-}
-.syntaxhighlighter .line.alt2 {
-  background-color: white !important;
-}
-.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
-  background-color: #e0e0e0 !important;
-}
-.syntaxhighlighter .line.highlighted.number {
-  color: black !important;
-}
-.syntaxhighlighter table caption {
-  color: black !important;
-}
-.syntaxhighlighter .gutter {
-  color: #afafaf !important;
-}
-.syntaxhighlighter .gutter .line {
-  border-right: 3px solid #6ce26c !important;
-}
-.syntaxhighlighter .gutter .line.highlighted {
-  background-color: #6ce26c !important;
-  color: white !important;
-}
-.syntaxhighlighter.printing .line .content {
-  border: none !important;
-}
-.syntaxhighlighter.collapsed {
-  overflow: visible !important;
-}
-.syntaxhighlighter.collapsed .toolbar {
-  color: blue !important;
-  background: white !important;
-  border: 1px solid #6ce26c !important;
-}
-.syntaxhighlighter.collapsed .toolbar a {
-  color: blue !important;
-}
-.syntaxhighlighter.collapsed .toolbar a:hover {
-  color: red !important;
-}
-.syntaxhighlighter .toolbar {
-  color: white !important;
-  background: #6ce26c !important;
-  border: none !important;
-}
-.syntaxhighlighter .toolbar a {
-  color: white !important;
-}
-.syntaxhighlighter .toolbar a:hover {
-  color: black !important;
-}
-.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
-  color: black !important;
-}
-.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
-  color: #008200 !important;
-}
-.syntaxhighlighter .string, .syntaxhighlighter .string a {
-  color: blue !important;
-}
-.syntaxhighlighter .keyword {
-  color: #006699 !important;
-}
-.syntaxhighlighter .preprocessor {
-  color: gray !important;
-}
-.syntaxhighlighter .variable {
-  color: #aa7700 !important;
-}
-.syntaxhighlighter .value {
-  color: #009900 !important;
-}
-.syntaxhighlighter .functions {
-  color: #ff1493 !important;
-}
-.syntaxhighlighter .constants {
-  color: #0066cc !important;
-}
-.syntaxhighlighter .script {
-  font-weight: bold !important;
-  color: #006699 !important;
-  background-color: none !important;
-}
-.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
-  color: gray !important;
-}
-.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
-  color: #ff1493 !important;
-}
-.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
-  color: red !important;
-}
-
-.syntaxhighlighter .keyword {
-  font-weight: bold !important;
-}
diff --git a/docs/src/templates/syntaxhighlighter/version.txt b/docs/src/templates/syntaxhighlighter/version.txt
deleted file mode 100644
index 79f60112..00000000
--- a/docs/src/templates/syntaxhighlighter/version.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-3.0.83
-
diff --git a/docs/src/writer.js b/docs/src/writer.js
index 7db55d3d..e99ad73e 100644
--- a/docs/src/writer.js
+++ b/docs/src/writer.js
@@ -7,7 +7,8 @@ var Q = require('qq');
 var OUTPUT_DIR = "build/docs/";
 var fs = require('fs');
 
-exports.output = function(file, content) {
+exports.output = output;
+function output(file, content) {
   var fullPath = OUTPUT_DIR + file;
   var dir = parent(fullPath);
   return Q.when(exports.makeDir(dir), function(error) {
@@ -39,7 +40,7 @@ exports.makeDir = function(path) {
 };
 
 exports.copyTpl = function(filename) {
-  return exports.copy('docs/src/templates/' + filename, OUTPUT_DIR + filename);
+  return exports.copy('docs/src/templates/' + filename, filename);
 };
 
 /* Copy files from one place to another.
@@ -56,7 +57,7 @@ exports.copy = function(from, to, transform) {
       args.unshift(content.toString());
       content = transform.apply(null, args);
     }
-    qfs.write(to, content);
+    return output(to, content);
   });
 }
 
@@ -72,25 +73,15 @@ exports.replace = function(content, replacements) {
 }
 
 exports.copyDir = function copyDir(dir) {
-  return qfs.listDirectoryTree('docs/' + dir).then(function(dirs) {
-    var done;
-    dirs.forEach(function(dirToMake) {
-      done = Q.when(done, function() {
-       return exports.makeDir("./build/" + dirToMake);
-      });
-    });
-    return done;
-  }).then(function() {
-    return qfs.listTree('docs/' + dir);
-  }).then(function(files) {
-    files.forEach( function(file) {
-      exports.copy(file,'./build/' + file);
+  return qfs.listTree('docs/' + dir).then(function(files) {
+    files.forEach(function(file) {
+      exports.copy(file, file.replace(/^docs\//, ''));
     });
   });
 };
 
 exports.merge = function(srcs, to) {
-  return merge(srcs.map(function(src) { return 'docs/src/templates/' + src; }), OUTPUT_DIR + to);
+  return merge(srcs.map(function(src) { return 'docs/src/templates/' + src; }), to);
 };
 
 function merge(srcs, to) {
@@ -107,7 +98,7 @@ function merge(srcs, to) {
   // write to file
   return Q.when(done, function(content) {
     contents.push(content);
-    qfs.write(to, contents.join('\n'));
+    return output(to, contents.join('\n'));
   });
 }
 
@@ -130,6 +121,8 @@ exports.toString = function toString(obj) {
         obj[key] = toString(value);
       });
       return obj.join('');
+    } else if (obj.constructor.name == 'Buffer'){
+      // do nothing it is Buffer Object
     } else {
       return JSON.stringify(obj);
     }
diff --git a/link-docs.sh b/link-docs.sh
new file mode 100755
index 00000000..2d39f496
--- /dev/null
+++ b/link-docs.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+./gen_docs.sh
+
+rm build/docs/index.html
+rm -rf build/docs/css
+rm -rf build/docs/js
+rm -rf build/docs/img
+rm -rf build/docs/examples
+
+cd build/docs
+
+ln -s ../../docs/src/templates/index.html
+ln -s ../../docs/src/templates/css
+ln -s ../../docs/src/templates/js
+ln -s ../../docs/img
+ln -s ../../docs/examples
diff --git a/src/bootstrap/bootstrap-prettify.js b/src/bootstrap/bootstrap-prettify.js
index 4d29199f..93bed809 100644
--- a/src/bootstrap/bootstrap-prettify.js
+++ b/src/bootstrap/bootstrap-prettify.js
@@ -21,7 +21,7 @@ function escape(text) {
 
 
 
-directive.jsFiddle = function(getEmbededTemplate, escape, script) {
+directive.jsFiddle = function(getEmbeddedTemplate, escape, script) {
   return {
     terminal: true,
     link: function(scope, element, attr) {
@@ -40,15 +40,15 @@ directive.jsFiddle = function(getEmbededTemplate, escape, script) {
           if (index == 0) {
             fields[fileType] +=
               '
\n' + - getEmbededTemplate(file, 2); + getEmbeddedTemplate(file, 2); } else { fields[fileType] += '\n\n\n \n' + ' \n'; } } else { - fields[fileType] += getEmbededTemplate(file) + '\n'; + fields[fileType] += getEmbeddedTemplate(file) + '\n'; } }); @@ -92,12 +92,12 @@ directive.prettyprint = ['reindentCode', function(reindentCode) { }]; -directive.ngSetText = ['getEmbededTemplate', function(getEmbededTemplate) { +directive.ngSetText = ['getEmbeddedTemplate', function(getEmbeddedTemplate) { return { restrict: 'CA', priority: 10, compile: function(element, attr) { - element.text(getEmbededTemplate(attr.ngSetText)); + element.text(getEmbeddedTemplate(attr.ngSetText)); } } }] @@ -134,21 +134,21 @@ directive.ngHtmlWrap = ['reindentCode', 'templateMerge', function(reindentCode, }]; -directive.ngSetHtml = ['getEmbededTemplate', function(getEmbededTemplate) { +directive.ngSetHtml = ['getEmbeddedTemplate', function(getEmbeddedTemplate) { return { restrict: 'CA', priority: 10, compile: function(element, attr) { - element.html(getEmbededTemplate(attr.ngSetHtml)); + element.html(getEmbeddedTemplate(attr.ngSetHtml)); } } }]; -directive.ngEvalJavascript = ['getEmbededTemplate', function(getEmbededTemplate) { +directive.ngEvalJavascript = ['getEmbeddedTemplate', function(getEmbeddedTemplate) { return { compile: function (element, attr) { - var script = getEmbededTemplate(attr.ngEvalJavascript); + var script = getEmbeddedTemplate(attr.ngEvalJavascript); try { if (window.execScript) { // IE @@ -254,7 +254,7 @@ service.templateMerge = ['reindentCode', function(indentCode) { }; }]; -service.getEmbededTemplate = ['reindentCode', function(reindentCode) { +service.getEmbeddedTemplate = ['reindentCode', function(reindentCode) { return function (id) { return reindentCode(angular.element(document.getElementById(id)).html(), 0); } diff --git a/src/bootstrap/bootstrap.js b/src/bootstrap/bootstrap.js index 831998fc..8a398ad3 100644 --- a/src/bootstrap/bootstrap.js +++ b/src/bootstrap/bootstrap.js @@ -19,7 +19,7 @@ directive.dropdownToggle = element.bind('click', function(event) { event.preventDefault(); - event.stopImmediatePropagation(); + event.stopPropagation(); var iWasOpen = false; @@ -34,7 +34,7 @@ directive.dropdownToggle = close = function (event) { event && event.preventDefault(); - event && event.stopImmediatePropagation(); + event && event.stopPropagation(); $document.unbind('click', close); element.parent().removeClass('open'); close = null; diff --git a/src/ng/cacheFactory.js b/src/ng/cacheFactory.js index 82c939cc..c91ffce7 100644 --- a/src/ng/cacheFactory.js +++ b/src/ng/cacheFactory.js @@ -151,6 +151,16 @@ function $CacheFactoryProvider() { }; } +/** + * @ngdoc object + * @name angular.module.ng.$templateCache + * + * @description + * Cache used for storing html templates. + * + * See {@link angular.module.ng.$cacheFactory $cacheFactory}. + * + */ function $TemplateCacheProvider() { this.$get = ['$cacheFactory', function($cacheFactory) { return $cacheFactory('templates'); diff --git a/src/ng/directive/ngClass.js b/src/ng/directive/ngClass.js index 1e9a260b..7e0d5dba 100644 --- a/src/ng/directive/ngClass.js +++ b/src/ng/directive/ngClass.js @@ -36,30 +36,35 @@ function classDirective(name, selector) { * names, an array, or a map of class names to boolean values. * * @example - - - + + +
- Sample Text      -
- + Sample Text + + + .my-class { + color: red; + } + + it('should check ng-class', function() { expect(element('.doc-example-live span').prop('className')).not(). - toMatch(/ng-invalid/); + toMatch(/my-class/); using('.doc-example-live').element(':button:first').click(); expect(element('.doc-example-live span').prop('className')). - toMatch(/ng-invalid/); + toMatch(/my-class/); using('.doc-example-live').element(':button:last').click(); expect(element('.doc-example-live span').prop('className')).not(). - toMatch(/ng-invalid/); + toMatch(/my-class/); }); - -
+ + */ var ngClassDirective = classDirective('', true); @@ -80,26 +85,33 @@ var ngClassDirective = classDirective('', true); * of the evaluation can be a string representing space delimited class names or an array. * * @example - - + +
  1. - - {{name}}       + + {{name}}
-
- + + + .odd { + color: red; + } + .even { + color: blue; + } + + it('should check ng-class-odd and ng-class-even', function() { expect(element('.doc-example-live li:first span').prop('className')). - toMatch(/ng-format-negative/); + toMatch(/odd/); expect(element('.doc-example-live li:last span').prop('className')). - toMatch(/ng-invalid/); + toMatch(/even/); }); - -
+ + */ var ngClassOddDirective = classDirective('Odd', 0); @@ -120,8 +132,8 @@ var ngClassOddDirective = classDirective('Odd', 0); * result of the evaluation can be a string representing space delimited class names or an array. * * @example - - + +
  1. @@ -129,15 +141,23 @@ var ngClassOddDirective = classDirective('Odd', 0);
-
- + + + .odd { + color: red; + } + .even { + color: blue; + } + + it('should check ng-class-odd and ng-class-even', function() { expect(element('.doc-example-live li:first span').prop('className')). toMatch(/odd/); expect(element('.doc-example-live li:last span').prop('className')). toMatch(/even/); }); - -
+ + */ var ngClassEvenDirective = classDirective('Even', 1); diff --git a/src/ng/directive/ngController.js b/src/ng/directive/ngController.js index 55da78cd..72bd3c00 100644 --- a/src/ng/directive/ngController.js +++ b/src/ng/directive/ngController.js @@ -33,7 +33,7 @@ * for a manual update. - -
- - url of the template: {{template.url}} -
-
-
-
- - it('should load template1.html', function() { - expect(element('.doc-example-live [ng-include]').text()). - toBe('Content of template1.html\n'); - }); - it('should load template2.html', function() { - select('template').option('1'); - expect(element('.doc-example-live [ng-include]').text()). - toBe('Content of template2.html\n'); - }); - it('should change to blank', function() { - select('template').option(''); - expect(element('.doc-example-live [ng-include]').text()).toEqual(''); - }); - -
+ + +
+ + url of the template: {{template.url}} +
+
+
+
+ + function Ctrl($scope) { + $scope.templates = + [ { name: 'template1.html', url: 'template1.html'} + , { name: 'template2.html', url: 'template2.html'} ]; + $scope.template = $scope.templates[0]; + } + + + Content of template1.html + + + Content of template2.html + + + it('should load template1.html', function() { + expect(element('.doc-example-live [ng-include]').text()). + toMatch(/Content of template1.html/); + }); + it('should load template2.html', function() { + select('template').option('1'); + expect(element('.doc-example-live [ng-include]').text()). + toMatch(/Content of template2.html/); + }); + it('should change to blank', function() { + select('template').option(''); + expect(element('.doc-example-live [ng-include]').text()).toEqual(''); + }); + +
*/ diff --git a/src/ng/directive/ngStyle.js b/src/ng/directive/ngStyle.js index c24c1b6d..30a266cd 100644 --- a/src/ng/directive/ngStyle.js +++ b/src/ng/directive/ngStyle.js @@ -13,15 +13,20 @@ * keys. * * @example - - + +
Sample Text
myStyle={{myStyle}}
-
- + + + span { + color: black; + } + + it('should check ng-style', function() { expect(element('.doc-example-live span').css('color')).toBe('rgb(0, 0, 0)'); element('.doc-example-live :button[value=set]').click(); @@ -29,8 +34,8 @@ element('.doc-example-live :button[value=clear]').click(); expect(element('.doc-example-live span').css('color')).toBe('rgb(0, 0, 0)'); }); - -
+ + */ var ngStyleDirective = ngDirective(function(scope, element, attr) { scope.$watch(attr.ngStyle, function(newStyles, oldStyles) { diff --git a/src/ng/directive/ngView.js b/src/ng/directive/ngView.js index 16ae792e..7c737765 100644 --- a/src/ng/directive/ngView.js +++ b/src/ng/directive/ngView.js @@ -14,51 +14,8 @@ * * @scope * @example - - - - - - - - + +
Choose: Moby | @@ -76,8 +33,52 @@
$route.current.scope.name = {{$route.current.scope.name}}
$routeParams = {{$routeParams}}
-
- + + + + controller: {{name}}
+ Book Id: {{params.bookId}}
+
+ + + controller: {{name}}
+ Book Id: {{params.bookId}}
+ Chapter Id: {{params.chapterId}} +
+ + + angular.module('ngView', [], function($routeProvider, $locationProvider) { + $routeProvider.when('/Book/:bookId', { + template: 'book.html', + controller: BookCntl + }); + $routeProvider.when('/Book/:bookId/ch/:chapterId', { + template: 'chapter.html', + controller: ChapterCntl + }); + + // configure html5 to get links working on jsfiddle + $locationProvider.html5Mode(true); + }); + + function MainCntl($scope, $route, $routeParams, $location) { + $scope.$route = $route; + $scope.$location = $location; + $scope.$routeParams = $routeParams; + } + + function BookCntl($scope, $routeParams) { + $scope.name = "BookCntl"; + $scope.params = $routeParams; + } + + function ChapterCntl($scope, $routeParams) { + $scope.name = "ChapterCntl"; + $scope.params = $routeParams; + } + + + it('should load and compile correct template', function() { element('a:contains("Moby: Ch1")').click(); var content = element('.doc-example-live [ng-view]').text(); @@ -90,8 +91,8 @@ expect(content).toMatch(/controller\: BookCntl/); expect(content).toMatch(/Book Id\: Scarlet/); }); -
-
+ + */ diff --git a/src/ng/directive/select.js b/src/ng/directive/select.js index dda59375..b269973f 100644 --- a/src/ng/directive/select.js +++ b/src/ng/directive/select.js @@ -75,7 +75,7 @@
  • Name: - [X] + [X]
  • [add] diff --git a/src/ng/http.js b/src/ng/http.js index 157c5d98..19b7d246 100644 --- a/src/ng/http.js +++ b/src/ng/http.js @@ -400,72 +400,75 @@ function $HttpProvider() { * * * @example - - - -
    - - -
    - - - -
    http status code: {{status}}
    -
    http response data: {{data}}
    -
    -
    - - it('should make an xhr GET request', function() { - element(':button:contains("Sample GET")').click(); - element(':button:contains("fetch")').click(); - expect(binding('status')).toBe('200'); - expect(binding('data')).toBe('Hello, $http!\n'); - }); + $scope.updateModel = function(method, url) { + $scope.method = method; + $scope.url = url; + }; + } + + + Hello, $http! + + + it('should make an xhr GET request', function() { + element(':button:contains("Sample GET")').click(); + element(':button:contains("fetch")').click(); + expect(binding('status')).toBe('200'); + expect(binding('data')).toMatch(/Hello, \$http!/); + }); - it('should make a JSONP request to angularjs.org', function() { - element(':button:contains("Sample JSONP")').click(); - element(':button:contains("fetch")').click(); - expect(binding('status')).toBe('200'); - expect(binding('data')).toMatch(/Super Hero!/); - }); + it('should make a JSONP request to angularjs.org', function() { + element(':button:contains("Sample JSONP")').click(); + element(':button:contains("fetch")').click(); + expect(binding('status')).toBe('200'); + expect(binding('data')).toMatch(/Super Hero!/); + }); - it('should make JSONP request to invalid URL and invoke the error handler', - function() { - element(':button:contains("Invalid JSONP")').click(); - element(':button:contains("fetch")').click(); - expect(binding('status')).toBe('0'); - expect(binding('data')).toBe('Request failed'); - }); - -
    + it('should make JSONP request to invalid URL and invoke the error handler', + function() { + element(':button:contains("Invalid JSONP")').click(); + element(':button:contains("fetch")').click(); + expect(binding('status')).toBe('0'); + expect(binding('data')).toBe('Request failed'); + }); + + */ function $http(config) { config.method = uppercase(config.method); diff --git a/src/ng/route.js b/src/ng/route.js index 895749fe..fd54b1c5 100644 --- a/src/ng/route.js +++ b/src/ng/route.js @@ -117,78 +117,85 @@ function $RouteProvider(){ Note that this example is using {@link angular.module.ng.$compileProvider.directive.script inlined templates} to get it working on jsfiddle as well. - - - + + +
    + Choose: + Moby | + Moby: Ch1 | + Gatsby | + Gatsby: Ch4 | + Scarlet Letter
    - +
    +
    - + // configure html5 to get links working on jsfiddle + $locationProvider.html5Mode(true); + }); -
    - Choose: - Moby | - Moby: Ch1 | - Gatsby | - Gatsby: Ch4 | - Scarlet Letter
    + function MainCntl($scope, $route, $routeParams, $location) { + $scope.$route = $route; + $scope.$location = $location; + $scope.$routeParams = $routeParams; + } -
    -
    + function BookCntl($scope, $routeParams) { + $scope.name = "BookCntl"; + $scope.params = $routeParams; + } -
    $location.path() = {{$location.path()}}
    -
    $route.current.template = {{$route.current.template}}
    -
    $route.current.params = {{$route.current.params}}
    -
    $route.current.scope.name = {{$route.current.scope.name}}
    -
    $routeParams = {{$routeParams}}
    -
    - - - it('should load and compile correct template', function() { - element('a:contains("Moby: Ch1")').click(); - var content = element('.doc-example-live [ng-view]').text(); - expect(content).toMatch(/controller\: ChapterCntl/); - expect(content).toMatch(/Book Id\: Moby/); - expect(content).toMatch(/Chapter Id\: 1/); + function ChapterCntl($scope, $routeParams) { + $scope.name = "ChapterCntl"; + $scope.params = $routeParams; + } + - element('a:contains("Scarlet")').click(); - content = element('.doc-example-live [ng-view]').text(); - expect(content).toMatch(/controller\: BookCntl/); - expect(content).toMatch(/Book Id\: Scarlet/); - }); - - + + it('should load and compile correct template', function() { + element('a:contains("Moby: Ch1")').click(); + var content = element('.doc-example-live [ng-view]').text(); + expect(content).toMatch(/controller\: ChapterCntl/); + expect(content).toMatch(/Book Id\: Moby/); + expect(content).toMatch(/Chapter Id\: 1/); + + element('a:contains("Scarlet")').click(); + content = element('.doc-example-live [ng-view]').text(); + expect(content).toMatch(/controller\: BookCntl/); + expect(content).toMatch(/Book Id\: Scarlet/); + }); + + */ /** @@ -238,7 +245,7 @@ function $RouteProvider(){ * @methodOf angular.module.ng.$route * * @description - * Causes `$route` service to reload the current route even if + * Causes `$route` service to reload theR current route even if * {@link angular.module.ng.$location $location} hasn't changed. * * As a result of that, {@link angular.module.ng.$compileProvider.directive.ngView ngView} diff --git a/src/ngSanitize/directive/ngBindHtml.js b/src/ngSanitize/directive/ngBindHtml.js index 10a0e904..d8ec4a41 100644 --- a/src/ngSanitize/directive/ngBindHtml.js +++ b/src/ngSanitize/directive/ngBindHtml.js @@ -7,8 +7,7 @@ * * @description * Creates a binding that will sanitize the result of evaluating the `expression` with the - * {@link angular.module.ngSanitize.$sanitize $sanitize} service and innerHTML the result into the - * current element. + * {@link angular.module.ngSanitize.$sanitize $sanitize} service and innerHTML the result into the current element. * * See {@link angular.module.ngSanitize.$sanitize $sanitize} docs for examples. *