mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-19 16:10:22 +00:00
change bootstrap to angular.compile
This commit is contained in:
parent
eb9e66f480
commit
88eca572fd
3 changed files with 5 additions and 12 deletions
|
|
@ -4,7 +4,6 @@
|
|||
<script type="text/javascript" src="../angular.js#autoBind=false"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
var angular = angularFactory({});
|
||||
var scope = angular.compile(document);
|
||||
scope.set('a', 3);
|
||||
scope.updateView();
|
||||
|
|
|
|||
|
|
@ -387,19 +387,15 @@ nglr.UrlWatcher.prototype.getUrl = function() {
|
|||
return window.location.href;
|
||||
};
|
||||
|
||||
window['angularFactory'] = function(config) {
|
||||
angular['compile'] = function(root, config) {
|
||||
config = config || {};
|
||||
var defaults = {
|
||||
server: ""
|
||||
};
|
||||
//todo: don't load stylesheet by default
|
||||
//todo: don't start watcher
|
||||
function compile(root){
|
||||
var loader = new nglr.Loader(root, jQuery("head"), _(defaults).extend(config));
|
||||
loader.load();
|
||||
return jQuery(root).scope();
|
||||
};
|
||||
return {
|
||||
compile:compile
|
||||
};
|
||||
var loader = new nglr.Loader(root, jQuery("head"), _(defaults).extend(config));
|
||||
loader.load();
|
||||
return jQuery(root).scope();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@ ExternalApiTest = TestCase("ExternalApiTest");
|
|||
ExternalApiTest.prototype = {
|
||||
testItShouldExposefactory:function(){
|
||||
var node = $('<div ng-init="a=1">{{b=a+1}}</div>')[0];
|
||||
var settings = {};
|
||||
var angular = angularFactory(settings);
|
||||
var scope = angular.compile(node);
|
||||
assertEquals(1, scope.get('a'));
|
||||
assertEquals(2, scope.get('b'));
|
||||
|
|
|
|||
Loading…
Reference in a new issue