Using a service/factory or not in an AngularJS app

6 posts, 0 answers
  1. Patrik Johansson
    Patrik Johansson avatar
    270 posts
    Member since:
    May 2010

    Posted 02 Dec 2015 Link to this post

    Considering that most Kendo UI controls (via Kendo UI DataSource) has direct support for talking with dataservices server side, is there any general recommendations if one should still use a "general" service/factory to handle data transfers or is it better to just let Kendo UI handle this directly? What would be the pros and cons of respective solution? Is there any best practices available that describes this more in detail?  
  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 04 Dec 2015 Link to this post

    Hello Patrik,

    The pros of using the build-in Kendo UI transport is that you will receive the functionality out of the box. On the other hand if you define custom DataSource transport that uses AngularJS service/factory to handle data transfers you will have more control on the way client communicates with the server.

    Which one you will prefer is a matter of preference and specific requirements.

    Regards,
    Alexander Valchev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Patrik Johansson
    Patrik Johansson avatar
    270 posts
    Member since:
    May 2010

    Posted 04 Dec 2015 in reply to Alexander Valchev Link to this post

    Hi,

     

    Thank you. Are there any special recommendations/considerations you think we should take into account if we decide to build our own implementation. I'm thinking of settings or similar that could affect the performance, security etc of the Kendo UI components and such?

     

  5. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 08 Dec 2015 Link to this post

    Hello Patrik,

     

    there is nothing Kendo UI specific that should affect the framework in this case. Feel free to pick the approach you find most suitable. 

     

    Regards,
    Petyo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. Patrik Johansson
    Patrik Johansson avatar
    270 posts
    Member since:
    May 2010

    Posted 12 Dec 2015 in reply to Petyo Link to this post

    Do you have some samples of how to use the Kendo UI Datasource combined with a general AngularJS factory/services? Perhaps using a Kendo UI Grid which I guess is the most commonly used control for stuff like this although I guess it's not much difference in this regard to other Kendo UI controls. 

    Are there any obvious drawbacks to not use Kendo UI Datasource directly against the WebAPI? What about authentication?

  7. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 15 Dec 2015 Link to this post

    Hello Patrik,

     

    Check this example. With it, the authentication part should be configured through the $http service. 

     

    Regards,
    Petyo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready