CRUD in ASP.NETCore MVC with Angular 2 and Web API

  • Modify the ConfigureServices method on Startup.cs file to create a connection to your database: public void ConfigureServices(IServiceCollection services) { var connection = @” Server=LFRUL-013;Database=DataBaseDotnetCore;Trusted_Connection=True;” ; services.
  • You will introduce some change in the Startup.cs file to support Angular2 Single Page Application , you should change the default ASP.NETCore MVC routing to point on the index page of the Angular2 project ( wwwroot/index.html ).
  • Update method: updates some content of an existing product into database by calling an existing web service [ /api/products ],
  • onUpdate method: Updates an existing product on the database by calling “Update method” of ” _service variable”,
  • Through the article, you will learn how you can create a CRUD web application.

A good example of how build a CRUD web application using ASP.NETCORE with Angular2 and WebApi; Author: ONasri 12202787; Updated: 16 Jan 2017; Section: Applications & Tools; Chapter: Web Development; Updated: 16 Jan 2017
Continue reading “CRUD in ASP.NETCore MVC with Angular 2 and Web API”

php

Xdebug is not running with WAMP  #angularjs #reactjs

  • Now I really do not know what went wrong and what I can do to use xdebug.
  • Stack Overflow works best with JavaScript enabled
  • I run php -m in command line and found no xdebug module
  • [PHP Modules] bcmath bz2 calendar calendar Core ctype curl date dom ereg exif fileinfo filter ftp gd gettext gmp hash iconv imap intl json ldap libxml mbstring mcrypt mhash mysql mysqli mysqlnd odbc openssl pcre PDO pdo_mysql pdo_sqlite Phar Reflection session shmop SimpleXML soap sockets SPL sqlite3 standard tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zip zlib [Zend Modules]
  • Summary Xdebug installed: no Server API: Command Line Interface Windows: yes – Compiler: MS VC11 – Architecture: x64 Zend Server: no PHP Version: 5.6.25 Zend API nr: 220131226 PHP API nr: 20131226 Debug Build: no Thread Safe Build: yes Configuration File Path: C:\WINDOWS Configuration File: F:\wamp64\bin\php\php5.6.25\php.ini Extensions directory: F:\wamp64\bin\php\php5.6.25\ext

Compiler MSVC11 (Visual C++ 2012)

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Xdebug v2.5.0, Copyright (c) 2002-2016, by Derick Rethans
Continue reading “php”

GitHub

  • Use yarn run compile instead, it compiles and builds:aot
  • Use yarn run build for production build.
  • To create AOT version, run yarn run compile .
  • State history is also not saved in production mode.

angular-webpack2-starter – A complete Angular 2 and Webpack 2 starter seed with minimal and full featured branches. Full featured branch includes: Material Design 2 (Bootstrap 4 branch available as well), @ngrx, HMR, DLLs and optional use of Universal for server-side rendering – Supports AOT (offline) compilation, sync and lazy loading. Karma/Protractor for e2e/unit tests.
Continue reading “GitHub”

Amazing Angular2 DOM Tips, Tricks, and Warnings

  • As I mentioned above, you can create template variables to allow you to access your child elements from your typescript code.
  • But you’ll produce code that is much easier to test if you avoid having your code reach up into the DOM to get current state information.
  • You might want to access child elements from your code.
  • When Angular2 realizes that the state has changed, it changes the DOM to reflect the change.
  • Now you can use this in your typescript using ViewChild() as explained above, or you can use it in your template as a regular variable.

I’ve learned quite a few things about Angular2 DOM tips, tricks, and warnings that you’ll want to pay attention to as you get started.
Continue reading “Amazing Angular2 DOM Tips, Tricks, and Warnings”

Angular JS 4

#angularjs 4 - The Latest #javascript Upgrade from Google:

  • The omission of numbers has been proposed by the Google official.
  • Angular JS 4 – The Latest JavaScript Upgrade from Google
  • Developers are still awaiting the updated version to be released especially after knowing what all they are getting from Angular JS 4.
  • Since its release, Angular JS has seen lot of updates which is quite common for Google.
  • This is one among the most awaited releases in Google’s open source frameworks.

Angular JS is the most popular JavaScript framework used by developers all around the world. The brainchild of Google, it is also considered to be the big daddy of JavaScript and was first released in 2009. The Angular ecosystem exploded in a big way and also developed beyond imagination. It boasts of incorporating the biggest network of web developers working on Single Page Web Applications.
Continue reading “Angular JS 4”

Angular 2 Lazy Loading with Webpack 2

  • The webpack.dev.js file requires that the chunkFilename property is set in the output, so that webpack chunks the lazy load modules.
  • The about module will be lazy loaded when the user clicks on the about tab.
  • The modules and entry points are also defined for the JIT build.
  • You can see that Webpack creates an extra chunked file for the About Module.
  • The files property contains all the module entry points as well as the app entry file.

This article shows how Angular 2 lazy loading can be supported using Webpack 2 for both JIT and AOT builds. The Webpack loader angular-router-loader from Brandon Roberts is used to implement this. A big thanks to Roberto Simonetti for his help in this. Code: Visual Studio 2015 project | Visual Studio 2017 project Blogs in…
Continue reading “Angular 2 Lazy Loading with Webpack 2”