A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://js.devexpress.com/Vue/Documentation/ApiReference/Data_Layer/EndpointSelector/Methods/ below:

DevExtreme Vue - EndpointSelector Methods

This section describes methods that control an EndpointSelector instance.

Gets an endpoint with a specific key.

jQuery
var endpointSelector = new DevExpress.data.EndpointSelector({
    db1: {
        local: "http://localhost:55555/service1.svc/",
        production: "http://services.example.com/service1.svc/"
    },
    db2: {
        local: "http://localhost:55555/service2.svc/",
        production: "http://services.example.com/service2.svc/"
    }
});

// Logs http://localhost:55555/service1.svc/ or http://services.example.com/service1.svc/
// depending on whether the app's local or deployed version is running 
console.log(endpointSelector.urlFor("db1"));
Angular
import EndpointSelector from "devextreme/data/endpoint_selector";
// ...
export class AppComponent {
    endpointSelector: EndpointSelector;
    constructor() {
        this.endpointSelector = new EndpointSelector({
            db1: {
                local: "http://localhost:55555/service1.svc/",
                production: "http://services.example.com/service1.svc/"
            },
            db2: {
                local: "http://localhost:55555/service2.svc/",
                production: "http://services.example.com/service2.svc/"
            }
        });

        // Logs http://localhost:55555/service1.svc/ or http://services.example.com/service1.svc/
        // depending on whether the app's local or deployed version is running 
        console.log(this.endpointSelector.urlFor("db1")); 
    }
}
Vue
<script>
import EndpointSelector from 'devextreme/data/endpoint_selector';

const endpointSelector = new EndpointSelector({
    db1: {
        local: 'http://localhost:55555/service1.svc/',
        production: 'http://services.example.com/service1.svc/'
    },
    db2: {
        local: 'http://localhost:55555/service2.svc/',
        production: 'http://services.example.com/service2.svc/'
    },
    // ...
});

export default {
    mounted() {
        // Logs http://localhost:55555/service1.svc/ or http://services.example.com/service1.svc/
        // depending on whether the app's local or deployed version is running 
        console.log(endpointSelector.urlFor('db1')); 
    },
    // ...
}
</script>
React
// ...
import EndpointSelector from 'devextreme/data/endpoint_selector';

const endpointSelector = new EndpointSelector({
    db1: {
        local: 'http://localhost:55555/service1.svc/',
        production: 'http://services.example.com/service1.svc/'
    },
    db2: {
        local: 'http://localhost:55555/service2.svc/',
        production: 'http://services.example.com/service2.svc/'
    },
    // ...
});

class App extends React.Component {
    constructor(props) {
        super(props);

        // Logs http://localhost:55555/service1.svc/ or http://services.example.com/service1.svc/
        // depending on whether the app's local or deployed version is running 
        console.log(endpointSelector.urlFor('db1')); 
    }
}
export default App;
Feel free to share topic-related thoughts here.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
Thank you for the feedback!

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4