Dart Documentationangular.core.domNgCoreDomModule

NgCoreDomModule class

class NgCoreDomModule extends Module {
 NgCoreDomModule() {
   value(TextChangeListener, null);
   factory(TemplateCache, (_) => new TemplateCache(capacity: 0));
   type(dom.NodeTreeSanitizer, implementedBy: NullTreeSanitizer);

   type(NgTextMustacheDirective);
   type(NgAttrMustacheDirective);

   type(Compiler);
   type(Http);
   type(UrlRewriter);
   type(HttpBackend);
   type(HttpDefaultHeaders);
   type(HttpDefaults);
   type(HttpInterceptors);
   type(BlockCache);
   type(GetterSetter);

 }
}

Extends

Module > NgCoreDomModule

Constructors

new NgCoreDomModule() #

Creates a new Object instance.

Object instances have no meaningful state, and are only useful through their identity. An Object instance is equal to itself only.

docs inherited from Object
NgCoreDomModule() {
 value(TextChangeListener, null);
 factory(TemplateCache, (_) => new TemplateCache(capacity: 0));
 type(dom.NodeTreeSanitizer, implementedBy: NullTreeSanitizer);

 type(NgTextMustacheDirective);
 type(NgAttrMustacheDirective);

 type(Compiler);
 type(Http);
 type(UrlRewriter);
 type(HttpBackend);
 type(HttpDefaultHeaders);
 type(HttpDefaults);
 type(HttpInterceptors);
 type(BlockCache);
 type(GetterSetter);

}

Properties

final Map<Type, Binding> bindings #

inherited from Module

Compiles and returs bindings map by performing depth-first traversal of the child (installed) modules.

Map<Type, Binding> get bindings {
 Map<Type, Binding> res = new HashMap<Type, Binding>();
 _childModules.forEach((child) => res.addAll(child.bindings));
 res.addAll(_bindings);
 return res;
}

Methods

void factory(Type id, FactoryFn factoryFn, {CreationStrategy creation, Visibility visibility}) #

inherited from Module

Register binding to a factory function.abstract

The factoryFn will be called and all its arguments will get injected. The result of that function is the value that will be injected.

void factory(Type id, FactoryFn factoryFn,
   {CreationStrategy creation, Visibility visibility}) {
 _bindings[id] = new FactoryBinding(factoryFn, creation, visibility);
}

void install(Module module) #

inherited from Module

Installs another module into this module. Bindings defined on this module take precidence over the installed module.

void install(Module module) => _childModules.add(module);

void type(Type id, {Type implementedBy, CreationStrategy creation, Visibility visibility}) #

inherited from Module

Register binding to a Type.

The implementedBy will be instantiated using new operator and the resulting instance will be injected. If no type is provided, then it's implied that id should be instantiated.

void type(Type id, {Type implementedBy, CreationStrategy creation,
   Visibility visibility}) {
 _bindings[id] = new TypeBinding(implementedBy == null ? id : implementedBy,
     creation, visibility);
}

void value(Type id, value, {CreationStrategy creation, Visibility visibility}) #

inherited from Module

Register binding to a concrete value.

The value is what actually will be injected.

void value(Type id, value,
   {CreationStrategy creation, Visibility visibility}) {
 _bindings[id] = new ValueBinding(value, creation, visibility);
}