Class Ember.LinkView
Ember.LinkView
renders an element whose click
event triggers a
transition of the application's instance of Ember.Router
to
a supplied route by name.
Instances of LinkView
will most likely be created through
the link-to
Handlebars helper, but properties of this class
can be overridden to customize application-wide behavior.
active
Defined in packages/ember-routing/lib/helpers/link_to.js:238
Accessed as a classname binding to apply the LinkView
's activeClass
CSS class
to the element when the link is active.
A LinkView
is considered active when its currentWhen
property is true
or the application's current route is the route the LinkView
would trigger
transitions into.
activeClass
Defined in packages/ember-routing/lib/helpers/link_to.js:66
The CSS class to apply to LinkView
's element when its active
property is true
.
ariaRole
Inherited from Ember.View packages/ember-views/lib/views/view.js:1867
The WAI-ARIA role of the control represented by this view. For example, a button may have a role of type 'button', or a pane may have a role of type 'alertdialog'. This property is used by assistive software to help visually challenged users navigate rich web applications.
The full list of valid WAI-ARIA roles is available at: http://www.w3.org/TR/wai-aria/roles#roles_categorization
attributeBindings
Defined in packages/ember-routing/lib/helpers/link_to.js:107
By default the {{link-to}}
helper will bind to the href
and
title
attributes. It's discourage that you override these defaults,
however you can push onto the array if needed.
classNameBindings
Defined in packages/ember-routing/lib/helpers/link_to.js:118
By default the {{link-to}}
helper will bind to the active
, loading
, and
disabled
classes. It is discouraged to override these directly.
classNames
Inherited from Ember.View packages/ember-views/lib/views/view.js:1882
Standard CSS class names to apply to the view's outer element. This property automatically inherits any class names defined by the view's superclasses as well.
concatenatedProperties
Inherited from Ember.CoreObject packages/ember-runtime/lib/system/core_object.js:202
Defines the properties that will be concatenated from the superclass (instead of overridden).
By default, when you extend an Ember class a property defined in
the subclass overrides a property with the same name that is defined
in the superclass. However, there are some cases where it is preferable
to build up a property's value by combining the superclass' property
value with the subclass' value. An example of this in use within Ember
is the classNames
property of Ember.View
.
Here is some sample code showing the difference between a concatenated property and a normal one:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
App.BarView = Ember.View.extend({ someNonConcatenatedProperty: ['bar'], classNames: ['bar'] }); App.FooBarView = App.BarView.extend({ someNonConcatenatedProperty: ['foo'], classNames: ['foo'], }); var fooBarView = App.FooBarView.create(); fooBarView.get('someNonConcatenatedProperty'); // ['foo'] fooBarView.get('classNames'); // ['ember-view', 'bar', 'foo'] |
This behavior extends to object creation as well. Continuing the above example:
1 2 3 4 5 6 |
var view = App.FooBarView.create({ someNonConcatenatedProperty: ['baz'], classNames: ['baz'] }) view.get('someNonConcatenatedProperty'); // ['baz'] view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz'] |
Adding a single property that is not an array will just add it in the array:
1 2 3 4 |
var view = App.FooBarView.create({ classNames: 'baz' }) view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz'] |
Using the concatenatedProperties
property, we can tell to Ember that mix
the content of the properties.
In Ember.View
the classNameBindings
and attributeBindings
properties
are also concatenated, in addition to classNames
.
This feature is available for you to use throughout the Ember object model, although typical app developers are likely to use it infrequently.
context
Inherited from Ember.View packages/ember-views/lib/views/view.js:962
The object from which templates should access properties.
This object will be passed to the template function each time the render method is called, but it is up to the individual function to decide what to do with it.
By default, this will be the view's controller.
controller
Inherited from Ember.View packages/ember-views/lib/views/view.js:913
The controller managing this view. If this property is set, it will be made available for use by the template.
disabled
Defined in packages/ember-routing/lib/helpers/link_to.js:224
Accessed as a classname binding to apply the LinkView
's disabledClass
CSS class
to the element when the link is disabled.
When true
interactions with the element will not trigger route changes.
disabledClass
Defined in packages/ember-routing/lib/helpers/link_to.js:86
The CSS class to apply to a LinkView
's element when its disabled
property is true
.
element
Inherited from Ember.View packages/ember-views/lib/views/view.js:1404
Returns the current DOM element for the view.
eventName
Defined in packages/ember-routing/lib/helpers/link_to.js:128
By default the {{link-to}}
helper responds to the click
event. You
can override this globally by setting this property to your custom
event name.
This is particularly useful on mobile when one wants to avoid the 300ms
click delay using some sort of custom tap
event.
href
Defined in packages/ember-routing/lib/helpers/link_to.js:370
Sets the element's href
attribute to the url for
the LinkView
's targeted route.
If the LinkView
's tagName
is changed to a value other
than a
, this property will be ignored.
isDestroyed
Inherited from Ember.CoreObject packages/ember-runtime/lib/system/core_object.js:267
Destroyed object property flag.
if this property is true
the observers and bindings were already
removed by the effect of calling the destroy()
method.
isDestroying
Inherited from Ember.CoreObject packages/ember-runtime/lib/system/core_object.js:278
Destruction scheduled flag. The destroy()
method has been called.
The object stays intact until the end of the run loop at which point
the isDestroyed
flag is set.
isView
Inherited from Ember.View packages/ember-views/lib/views/view.js:840
concatenatedProperties: ['classNames', 'classNameBindings', 'attributeBindings'], /**
isVisible
Inherited from Ember.View packages/ember-views/lib/views/view.js:1029
If false
, the view will appear hidden in DOM.
layout
Inherited from Ember.View packages/ember-views/lib/views/view.js:925
A view may contain a layout. A layout is a regular template but
supersedes the template
property during rendering. It is the
responsibility of the layout template to retrieve the template
property from the view (or alternatively, call Handlebars.helpers.yield
,
{{yield}}
) to render it in the correct location.
This is useful for a view that has a shared wrapper, but which delegates
the rendering of the contents of the wrapper to the template
property
on a subclass.
layoutName
Inherited from Ember.View packages/ember-views/lib/views/view.js:869
The name of the layout to lookup if no layout is provided.
Ember.View
will look for a template with this name in this view's
templates
object. By default, this will be a global object
shared in Ember.TEMPLATES
.
loading
Defined in packages/ember-routing/lib/helpers/link_to.js:263
Accessed as a classname binding to apply the LinkView
's loadingClass
CSS class
to the element when the link is loading.
A LinkView
is considered loading when it has at least one
parameter whose value is currently null or undefined. During
this time, clicking the link will perform no transition and
emit a warning that the link is still in a loading state.
loadingClass
Defined in packages/ember-routing/lib/helpers/link_to.js:76
The CSS class to apply to LinkView
's element when its loading
property is true
.
loadingHref
Defined in packages/ember-routing/lib/helpers/link_to.js:388
The default href value to use while a link-to is loading. Only applies when tagName is 'a'
nearestChildOf
Inherited from Ember.View packages/ember-views/lib/views/view.js:1126
- returns
- Ember.View
Return the nearest ancestor whose parent is an instance of
klass
.
nearestOfType
Inherited from Ember.View packages/ember-views/lib/views/view.js:1089
- returns
- Ember.View
Return the nearest ancestor that is an instance of the provided class or mixin.
nearestWithProperty
Inherited from Ember.View packages/ember-views/lib/views/view.js:1110
- returns
- Ember.View
Return the nearest ancestor that has a given property.
parentView
Inherited from Ember.CoreView packages/ember-views/lib/views/view.js:78
If the view is currently inserted into the DOM of a parent view, this property will point to the parent of the view.
rel
Defined in packages/ember-routing/lib/helpers/link_to.js:58
Sets the rel
attribute of the LinkView
's HTML element.
replace
Defined in packages/ember-routing/lib/helpers/link_to.js:97
Determines whether the LinkView
will trigger routing via
the replaceWith
routing strategy.
tagName
Inherited from Ember.View packages/ember-views/lib/views/view.js:1851
Tag name for the view's outer element. The tag name is only used when an
element is first created. If you change the tagName
for an element, you
must destroy and recreate the view element.
By default, the render buffer will use a <div>
tag for views.
template
Inherited from Ember.View packages/ember-views/lib/views/view.js:891
The template used to render the view. This should be a function that accepts an optional context parameter and returns a string of HTML that will be inserted into the DOM relative to its parent view.
In general, you should set the templateName
property instead of setting
the template yourself.
templateName
Inherited from Ember.View packages/ember-views/lib/views/view.js:856
The name of the template to lookup if no template is provided.
Ember.View
will look for a template with this name in this view's
templates
object. By default, this will be a global object
shared in Ember.TEMPLATES
.
templates
Inherited from Ember.View packages/ember-views/lib/views/view.js:882
The hash in which to look for templateName
.
title
Defined in packages/ember-routing/lib/helpers/link_to.js:50
Sets the title
attribute of the LinkView
's HTML element.
views
Inherited from Ember.View packages/ember-views/lib/views/view.js:2467
Global views hash