Directive.Restrict
Constructor and Description |
---|
AbstractDirective() |
Modifier and Type | Method and Description |
---|---|
void |
compile(JQElement element,
com.asayama.gwt.jsni.client.JSON attrs)
In AngularJS, compile method returns linker function.
|
String |
getName()
Returns the name of the directive.
|
Directive.Restrict[] |
getRestrict() |
com.google.gwt.resources.client.TextResource |
getTemplate() |
String |
getTemplateUrl() |
boolean |
getTransclude() |
void |
link(NGScope scope,
JQElement element,
com.asayama.gwt.jsni.client.JSON attrs) |
NGScope |
scope()
User must override this method to create isolateScope.
|
void |
setName(String name)
Assigns a name to the instance of the directive.
|
public boolean getTransclude()
getTransclude
in interface Directive
public final String getName()
com.asayama.directive.FooBar
would have the name
"fooBar
".getName
in interface Directive
AbstractModule.directive(Class)
public final void setName(String name)
public Directive.Restrict[] getRestrict()
getRestrict
in interface Directive
public com.google.gwt.resources.client.TextResource getTemplate()
getTemplate
in interface Directive
public String getTemplateUrl()
getTemplateUrl
in interface Directive
public NGScope scope()
@Override
public NGScope scope() {
NGScope isolateScope = NGScope.create();
isolateScope.put(getName(), "=");
return isolateScope;
}
public void compile(JQElement element, com.asayama.gwt.jsni.client.JSON attrs)
Directive
DefaultDirectiveFactory
wraps the call to
Directive.link(NGScope, JQElement, JSON)
into a JavaScript function, and
returns that from the JavaScript wrapping of the compile function call.
This means that, unlike AngularJS, we currently do not support compile dependent linker option (i.e. the outcome of compile function cannot return different linker functions).
Copyright © 2015. All rights reserved.