Skip to content

Instantly share code, notes, and snippets.

Dhananjay Kumar debugmodedotnet

Block or report user

Report or block debugmodedotnet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View cdjs6.js
set: function (newvalue) {
value = newvalue;
elements.forEach(e => {
if (e.getAttribute('data-geek97-bind') === bindingProperty) {
if (e.type === 'text') {
e.value = newvalue
}
else if (!e.type) {
e.innerHTML = newvalue
}
View cdjs5.js
function addToScope(){
if(!dbrepo.hasOwnProperty(bindingProperty)){
let value;
Object.defineProperty(dbrepo,bindingProperty,{
configurable:true,
enumerable:true ,
set: function(newvalue){
value = newvalue;
},
View cdjs5.js
function addToScope(){
if(!dbrepo.hasOwnProperty(bindingProperty)){
let value;
Object.defineProperty(dbrepo,bindingProperty,{
configurable:true,
enumerable:true ,
set: function(newvalue){
value = newvalue;
},
View cdjs3.js
var elements = document.querySelectorAll('[data-geek97-bind]');
var dbrepo = {};
elements.forEach((element)=>{
if(element.type === 'text'){
let bindingProperty = element.getAttribute('data-geek97-bind');
console.log(bindingProperty);
}
});
View cdjs2.js
(function (){
console.log('Implementing two way data binding');
})();
View db1.html
<body>
<h2>Two-way data binding</h2>
Name: <input data-geek97-bind="name" type="text">
<span data-geek97-bind="name"> </span>
<span data-geek97-bind="name"> </span>
<script src="databinding.js"></script>
</body>
View typeofactiontype10.cs
public IEnumerable<Training> GetAllTrainings()
{
return trainings;
}
View typeofactiontype8.cs
[Route("Data")]
[HttpGet]
public IHttpActionResult GetData()
{
var data = GetAllTrainings();
return new TrainingDataResponse(data.ToList(), Request);
}
View typeofactiontype7.cs
public class TrainingDataResponse : IHttpActionResult
{
List<Training> _data;
HttpRequestMessage _request;
public TrainingDataResponse(List<Training> data, HttpRequestMessage request)
{
_data = data;
_request = request;
View typeofactiontype5.cs
[Route("gettrainings/{id:int}")]
[HttpGet]
public IHttpActionResult GetTraining(int id)
{
var training = trainings.FirstOrDefault((t) => t.Id == id);
if(training == null)
{
return NotFound();
}
You can’t perform that action at this time.