We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

how to use angularjs ng-model within html.editor model in mvc

Thread ID:

Created:

Updated:

Platform:

Replies:

121109 Nov 11,2015 04:38 AM Nov 12,2015 07:29 AM ASP.NET MVC 1
loading
Tags: DateTimePicker
kssan
Asked On November 11, 2015 04:38 AM

@Html.EditorFor(model => model.StartDate, new { ng_model = "model.StartDate" })
{{model.StartDate}}

i have to print date in client side when i change date-time picker. how can i do this? i used angularJS but i could not print the date. 

Harikrishnan P [Syncfusion]
Replied On November 12, 2015 07:29 AM

Hi Kssan,


Thanks for contacting Syncfusion support.


To achieve your requirement (“print the datetime, when it is changed”) you can make use of the client side events. Using the “change” event of the DateTimePicker, you can print the value as shown in the below code.



<script>

    function onChange(e) {

        $("#datetime").text(e.value);

    }

</script>



We have attached a sample for your reference, please chk it.


http://www.syncfusion.com/downloads/support/forum/121109/ze/SyncfusionMvcApplication1_(2)-1760516954


While using Razor syntax, we cannot achieve the two way binding, since to use the Angular support in our component, we need to use the directive “ej-datetimepicker”. Also we need to bind the variable to the $scope.


To know more about the Angular JS support in our components, please refer the following link


http://help.syncfusion.com/js/angularjs


Our EJMVC components are created as wrapper for the JavaScript components. So the API, and events will be the same in both JS and EJMVC components. You can refer the following API reference section present in our online JS help document to know about the list of API’s, methods and events supported by each components.


http://docs.syncfusion.com/js/api/ejaccordion


Regards,

HariKrishnan


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;