diff --git a/dist/angularAMD.js b/dist/angularAMD.js index 56bd9a4..b80964c 100644 --- a/dist/angularAMD.js +++ b/dist/angularAMD.js @@ -1,8 +1,9 @@ -/*! - angularAMD v0.2.1 +/* + angularAMD v<%= cvars.proj_version %> (c) 2013-2014 Marcos Lin https://github.com/marcoslin/ License: MIT */ + define(function () { 'use strict'; var bootstrapped = false, @@ -95,6 +96,11 @@ define(function () { }; window.angular = alt_angular; + + if (require.defined('angular')) { + require.undef('angular'); + define('angular', [], alt_angular); + } } // Constructor @@ -189,15 +195,16 @@ define(function () { if (typeof alt_angular === 'undefined') { throw new Error('Alternate angular not set. Make sure that `enable_ngload` option has been set when calling angularAMD.bootstrap'); } - + // Process alternate queue in FIFO fashion function processRunBlock(block) { //console.info('"' + item.name + '": executing run block: ', run_block); run_injector.invoke(block); } - while (alternate_queue.length) { - var item = alternate_queue.shift(), + // Process the config blocks + for (var i=0;i'); + element = $compile(element)(scope); + scope.prop = 'loaded'; + scope.$digest(); + }) + }); + + it(".component check.", function() { + var h3 = element.find('h3'); + expect(h3.text()).toBe('Component Title loaded'); + }); + }) }; }); \ No newline at end of file diff --git a/test/unit/lib/component.js b/test/unit/lib/component.js new file mode 100644 index 0000000..c4c53d8 --- /dev/null +++ b/test/unit/lib/component.js @@ -0,0 +1,17 @@ +define(['app', 'angularAMD'], function (app, angularAMD) { + var comp_name = "mainComponent"; + + // console.log('component called'); + + app.component(comp_name, { + bindings: { + compBind: '@' + }, + controller: function() { + this.title = 'Component Title'; + }, + template: '

{{ $ctrl.title }} {{ $ctrl.compBind }}

' + }); + + return this; +}); diff --git a/test/unit/lib/main.mustache b/test/unit/lib/main.mustache index f696326..1f104db 100644 --- a/test/unit/lib/main.mustache +++ b/test/unit/lib/main.mustache @@ -19,6 +19,7 @@ 'services': 'test/unit/lib/services', 'regServices': 'test/unit/lib/regServices', 'controller': 'test/unit/lib/controller', + 'component' : 'test/unit/lib/component', 'regController': 'test/unit/lib/regController', 'decoServices': 'test/unit/lib/decoServices' },