{{albumctrl.goatPics.title}}
diff --git a/ChrisPerez/app/js/first/directives/FirstDirective.js b/ChrisPerez/app/js/first/directives/FirstDirective.js index a2292a1..566f19f 100644 --- a/ChrisPerez/app/js/first/directives/FirstDirective.js +++ b/ChrisPerez/app/js/first/directives/FirstDirective.js @@ -10,6 +10,5 @@ module.exports = function(app) { url: '@' } }; - }); }; diff --git a/ChrisPerez/app/js/first/directives/ThirdDirective.js b/ChrisPerez/app/js/first/directives/ThirdDirective.js index 5d7bfaf..6fb2662 100644 --- a/ChrisPerez/app/js/first/directives/ThirdDirective.js +++ b/ChrisPerez/app/js/first/directives/ThirdDirective.js @@ -13,6 +13,5 @@ module.exports = function(app) { width: '@' } }; - }); }; diff --git a/ChrisPerez/test/directive_test.js b/ChrisPerez/test/directive_test.js index 903f755..0cf664f 100644 --- a/ChrisPerez/test/directive_test.js +++ b/ChrisPerez/test/directive_test.js @@ -5,6 +5,9 @@ require('angular-mocks'); require('../app/js/client'); const firstTemplate = require('../app/templates/FirstApp/FirstTemplate.html'); +const albumTemplate = require('../app/templates/FirstApp/AlbumTemplate.html'); +const fullTemplate = require('../app/templates/FirstApp/FullTemplate.html'); +const textTemplate = require('../app/templates/FirstApp/TextTemplate.html'); describe('directive tests', ()=>{ let $httpBackend; @@ -49,4 +52,89 @@ describe('directive tests', ()=>{ expect(text2).toBe('Description: A test thing'); expect(text3).toBe('Source: test.jpg'); }); + + // it('should display an album', ()=>{ + // $httpBackend.expectGET('./templates/FirstApp/AlbumTemplate.html') + // .respond(200, albumTemplate); + // $httpBackend.expectGET('./templates/FirstApp/FullTemplate.html') + // .respond(200, fullTemplate); + // // + // + // let testAlbum = [ + // { + // label: 'label1', + // description: 'd1', + // url: '1.jpg', + // width: 100 + // }, + // { + // label: 'label2', + // description: 'd2', + // url: '2.jpg', + // width: 100 + // }, + // { + // label: 'label3', + // description: 'd3', + // url: '3.jpg', + // width: 100 + // } + // ]; + // + // let link = $compile( + // 'form = {{user | json}}
+ master = {{master | json}}
+ This renders because the controller does not fail to + instantiate, by using explicit annotation style (see + script.js for details) +
++ Hello, {{name}}! + +
This renders because the controller does not fail to + instantiate, by using explicit annotation style + (see script.js for details) +
+The controller could not be instantiated, due to relying + on automatic function annotations (which are disabled in + strict mode). As such, the content of this section is not + interpolated, and there should be an error in your web console. +
++ * Use this method to disable automatic scrolling. + * + * If automatic scrolling is disabled, one must explicitly call + * {@link ng.$anchorScroll $anchorScroll()} in order to scroll to the element related to the + * current hash. + */ + this.disableAutoScrolling = function() { + autoScrollingEnabled = false; + }; + + /** + * @ngdoc service + * @name $anchorScroll + * @kind function + * @requires $window + * @requires $location + * @requires $rootScope + * + * @description + * When called, it scrolls to the element related to the specified `hash` or (if omitted) to the + * current value of {@link ng.$location#hash $location.hash()}, according to the rules specified + * in the + * [HTML5 spec](http://www.w3.org/html/wg/drafts/html/master/browsers.html#an-indicated-part-of-the-document). + * + * It also watches the {@link ng.$location#hash $location.hash()} and automatically scrolls to + * match any anchor whenever it changes. This can be disabled by calling + * {@link ng.$anchorScrollProvider#disableAutoScrolling $anchorScrollProvider.disableAutoScrolling()}. + * + * Additionally, you can use its {@link ng.$anchorScroll#yOffset yOffset} property to specify a + * vertical scroll-offset (either fixed or dynamic). + * + * @param {string=} hash The hash specifying the element to scroll to. If omitted, the value of + * {@link ng.$location#hash $location.hash()} will be used. + * + * @property {(number|function|jqLite)} yOffset + * If set, specifies a vertical scroll-offset. This is often useful when there are fixed + * positioned elements at the top of the page, such as navbars, headers etc. + * + * `yOffset` can be specified in various ways: + * - **number**: A fixed number of pixels to be used as offset.
+ * - **function**: A getter function called everytime `$anchorScroll()` is executed. Must return + * a number representing the offset (in pixels).
+ * - **jqLite**: A jqLite/jQuery element to be used for specifying the offset. The distance from + * the top of the page to the element's bottom will be used as offset.
+ * **Note**: The element will be taken into account only as long as its `position` is set to + * `fixed`. This option is useful, when dealing with responsive navbars/headers that adjust + * their height and/or positioning according to the viewport's size. + * + *
+ *
+ * The example below illustrates the use of a vertical scroll-offset (specified as a fixed value). + * See {@link ng.$anchorScroll#yOffset $anchorScroll.yOffset} for more details. + * + * @example +
Cached Values
+Cache Info
+-
+ *
- **id**: the id of the cache instance + *
- **size**: the number of entries kept in the cache instance + *
- **...**: any additional properties from the options object when creating the + * cache. + *