mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-21 01:57:06 +08:00
refactor(compiler) turn compiler into a service
BREAK - remove angular.compile() since the compile method is now a service and needs to be injected
This commit is contained in:
@@ -130,7 +130,8 @@ var NG_OPTIONS_REGEXP = /^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+
|
||||
angularWidget('select', function(element){
|
||||
this.directives(true);
|
||||
this.descend(true);
|
||||
return element.attr('ng:model') && annotate('$formFactory', function($formFactory, selectElement){
|
||||
return element.attr('ng:model') &&
|
||||
annotate('$formFactory', '$compile', function($formFactory, $compile, selectElement){
|
||||
var modelScope = this,
|
||||
match,
|
||||
form = $formFactory.forElement(selectElement),
|
||||
@@ -245,7 +246,7 @@ angularWidget('select', function(element){
|
||||
// developer declared null option, so user should be able to select it
|
||||
nullOption = jqLite(option).remove();
|
||||
// compile the element since there might be bindings in it
|
||||
compile(nullOption)(modelScope);
|
||||
$compile(nullOption)(modelScope);
|
||||
}
|
||||
});
|
||||
selectElement.html(''); // clear contents
|
||||
|
||||
Reference in New Issue
Block a user