Please enable JavaScript.
Coggle requires JavaScript to display documents.
.
Ember
. - Coggle Diagram
.
Ember
.
Components
- you can pass arguments into the component from template and viceversa
- pass args into the components by using @
- these passed args can also be accessed inside the component-class through the this.args param,
that will be available inside the corresponding component-class by default
args and its values are automatically tracked,
so there's no need to annotate them
Additionally, args is not mutable, and is frozen in development modes. This is partially to prevent folks from trying to accomplish two-way bindings (which doesn't work, this is discussed in more detail below) and partially to ensure that args always stays in sync with the arguments passed to the component, so it can be the canonical "single source of truth". If you want to provide defaults to an argument, you should use a getter.
- component
- component class
both are connected
Service Injection
When, a property of one component should be made available to other components,
service injections are used
-
CONTROLLERS
CONTROLLERS are for the routes(or templates), what component-classes are for components
-
-
Routes
:!: IMPORTANT when using link-to and dynamic segments
- if model is passed to the **@model attribute as part of dynamic segment, the route model will not** be called
and the id property of the model object will be inferred as the replacement to the dynamic segment in URL
- else, if the id alone is passed, the route model will be called
happy happy
PASS MULTIPLE MODELS
- model - single model
- models - multiple models, with the help of {{array}} helper
eg : models = {{array comment.photo comment}}
-
ROUTER
FILE PATH : app/templates/router.js
- this.route('home', function() {
// here you can even remove the "right" from the right/:right_id
// but, then should give the url as "home/<model or id>" in the browser
which means , you can literally add any number of /<path_name> in the path property
- but then, the url also has to contain the same path traverse before the dynamic segment
EMBER DATA
Ember Store
- it is, by default injected into all routes and controllers
- i.e.., you can access the store directly by this.store
- but,