Posts

Showing posts from May, 2019

AngularJs 4-7

Issue fixed while running the default project for angular in visual studio 2017 Set package.json-- change "start": "ng serve",     "build": "ng build", Start.cs    if (env.IsDevelopment())                 {                     //Time limit extended                     spa.Options.StartupTimeout = new System.TimeSpan(days: 0, hours: 0, minutes: 1, seconds: 30); // add this line                     //Time limit extended                     spa.UseAngularCliServer(npmScript: "start");                                 } https://www.janbasktraining.com/blog/angularjs-vs-angular/ Angular 4 with Visual studio Ref: https://dotnetthoughts.net/how-to-use-angular4-wth-aspnet-mvc/

Differences

AngularJs Factory and Services. References: https://blog.thoughtram.io/angular/2015/07/07/service-vs-factory-once-and-for-all.html The difference between services and factories we can define a service like this: app . service ( 'MyService' , function () { this . sayHello = function () { console . log ( 'hello' ); }; }); .service()  is a method on our module that takes a name and a function that defines the service. app . factory ( 'MyService' , function () { return { sayHello : function () { console . log ( 'hello' ); } } }); .factory()  is a method on our module and it also takes a name and a function, that defines the factory.   a service is a constructor function  where as a factory is Not .T here’s ' this ' code that calls  Object.create() with the service constructor function, when it gets instantiated. However, a factory function is really just a function that gets called,

Jquery

AJAX = Asynchronous JavaScript and XML. DOM = Document Object Model The DOM defines a standard for accessing HTML and XML documents: "The W3C Document Object Model (DOM) is a platform and language-neutral interface  that allows programs and scripts to dynamically access  and update the content, structure, and style of a document." Interview Question https://career.guru99.com/top-50-jquery-interview-questions/ Automatically Refresh or Reload Page using SetInterval() Method In the second example, I am using the SetInterval() method to call the .reload() function. <script>     $(document).ready(function() {         // Call refresh page function after 5000 milliseconds (or 5 seconds).         setInterval('refreshPage()', 5000);     });     function refreshPage() {         location.reload();     } </script> setInterval ( function () { window . location . reload (); }, 300000 ); Jsonp: Jquery a