lib/angular-rails-engine.rb in angular-rails-engine-0.9.2.2 vs lib/angular-rails-engine.rb in angular-rails-engine-1.0.7.0

- old
+ new

@@ -2,11 +2,11 @@ module ActionViewExtensions OFFLINE = (::Rails.env.development? or ::Rails.env.test?) CDNS = { :angular_js => { - :default => "//ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js" + :default => "//ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js" } } def angular_js_url(name) return CDNS[:angular_js][name] @@ -20,11 +20,12 @@ if OFFLINE and !options.delete(:force) options.delete(:local_copy) # not used in OFFLINE mode return javascript_include_tag(angularjs, options) else + local_copy = options.delete(:local_copy) j = [ javascript_include_tag(angular_js_url(name), options) ] - if options.delete(:local_copy) + if local_copy j << javascript_tag("window.angular || document.write(unescape('#{javascript_include_tag(angularjs, options).gsub('<','%3C')}'))") end j.join("\n").html_safe end end