3.1.0 • Published 7 years ago

vue-servicecontainer v3.1.0

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago

vue-servicecontainer

Install

npm i vue-servicecontainer --save

Setup

Load the container plugin

let ServiceContainer = require('vue-servicecontainer');

Since we can't load the services dynamically in the browser we have to link files to their classes. These path should be exactly like those in the config file

 Vue.use(ServiceContainer, {
     json : require('./src/View/Config/Services.json'),
     services : {
         "../Service/Group.service.js" : require('./src/View/Service/Group.service'),
     }
 });
 
 

Config

{

    "parameters": {
        "group_service.file":"../Service/Group.service.js",
    },
    
    "services": {
        "group": {
            "file":"%group_service.file%",
            "arguments":[]
        },

    }
}

Usage

In your component you have now the $container property that links to the vue-servicecontainer plugin

this.$container.get('group').Do_Something()
3.1.0

7 years ago

2.0.0

7 years ago

1.2.0

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago