pluginobject (instead of an Angular module) to call any component registration functions. You also need to prepend all component names with your registered namespace.
Template code (HTML):
In order for components to get ahold of their dependencies, Angular wires everything using a dependency injection subsystem. All of the components above (except for constants) were registered using inline array annotation; you pass an array, whose elements consist of a list of strings (the names of the dependencies), followed by the factory function taking a set of dependency arguments that match the list of string names.
The list of strings tell Angular which dependencies are required. Angular then passes those dependencies into the function you define - then you can use them inside of your code however you like.
The first way to create a service is through the Service recipe. When you’re using a Service, it’s instantiated with the
new keyword, so you can add properties to
this and the service will return
this. When you inject the service as a dependency into a component, those properties on
this will now be available on that component through your service.
The second way to create a service is through the Factory recipe. Unlike the Service recipe, it’s not instantiated with the
new keyword. When you’re using Factory, you create an object, add properties to it, then return that same object.
In additional to creating your own services, you can also use the services provided by Zengine.
Sometimes you want to attach a specified behavior to a DOM element. To do this, you can create directives. Just register the directive in your plugin.js code the same way you would in Angular, except with the plugin object.
The result will look like this:
Name: Watson, Naomi