Class ifcDirectives.Route
Class defined in:src/directives/route.js:1
ifcRoute
( ifcRoute
)
src/directives/route.js:16
ifc-route
observes the value assigned to itself html attribute to update the content
of the html element using the controller and view specified by the provided route, so
the value should be an existing route registered with Angular $routeProvder
.
For better understanding, you can think that its behaviour is the same that ngView
, bearing
in mind that it is not updated when the route change, only when its value change.
This directive is useful when you need to execute different behaviour (controller + view) in
some part of your layout (i.e outside ngView
you have a widget) but it doesn't have to change
for each route change (e.g. some routes use the same widget) or a part of a view which you
need to change without changing the route; although this behaviour can be implemented using
a controller that listen events and for each event the controller update variables and the
view using ngTemplate
, it's cleaner to add a controller which listens the events to update
the value of this directive or just using a $rootScope
variable, so the different behaviours
are implemented with a controller and view, keeping them separated rather than all of them
together in a controller or service.
-
ifcRoute
<String>A binding string ({{scopeVarName}}) for a variable referenced in the $scope