Module in angular

Angular 11
[quads id=RndAds] Module in angularIn this tutorial we will discuss and understand module in angular , one of the important part of our angular application. Will be discussing asWhat is the module in angular?What is use of module?What are the different part of NgModule Decorator?How to create new module?What is module in angularAngular module is used to group an interrelated set of Angular primitives, including components, directives and pipes that are closely related and meant to be used together.In Angular, a module is a mechanism to group components, directives, pipes and services that are related, in such a way that can be combined with other modules to create an application.In other words, Angular modules are classes. In a class, we can define public or private methods. The public methods are…
Read More

Template and TemplateUrl in angular

Angular 11
[quads id=RndAds] Template and TemplateUrl in Angular 11In this tutorial we will discuss template and templateurl properties of the Component decorator.As we have already discussed in our previous video that @Component decorator is a function that accepts one object and this object has many properties. In this video, will discuss two important properties i.e. template and templateUrl.In angular we need to create the html or view to represent the data or accept the data from the user.  We can create the template as.Inline templateExternal TemplateUsing Inline TemplatesThe inline templates are directly specified in the component decorator using the template property. That means you need to write the required HTML inside the typescript file. All your html creating like forms, controls and javascript should be added inline it self.lets modify the…
Read More

entity framework core savechanges

Entity Framework Core
[quads id=RndAds] [quads id=RndAds] Entity Framework Core SaveChanges | Save DataIn this entity framework core tutorial will discuss to save data using entity framework core savechanges method and it will includes insert, update and delete operations.Entity Framework Core provides different ways to add, update, or delete data in the database for that we need to use entity framework core savechanges method. An entity contains data in its scalar property will be either inserted or updated or deleted based on its EntityState.Step 1: Create interface ‘IStudentContract.cs’.public interface IStudentContract { Student GetStudent(int id); List GetAllStudent(); List GetAllStudentByName(string name); void Add(Student student); void Update(Student student); void Delete(int studentID); }Step 2: Create service ‘StudentService.cs’ which impments the above contract.public class StudentService : IStudentContract { public List GetAllStudent() { var context = new SchoolContext(); List students =…
Read More

Component In Angular

Angular 11
[quads id=RndAds] Component in AngularIn this tutorial we will discuss and understand main building block of angular i.e component. We will discuss as.What is the component?What is the default component?How to create a new component?What are the building blocks of components?If you worked with Angular 1 (i.e. AngularJS) applications, then you may aware of controllers, directives, and scopes that are used to bind the data and logic to a view. But in Angular 2 or any higher versions application, the component alone performs all the tasks which are performed.What is ComponentThe Component is the main building block of an Angular Application.The component contains the data & user interaction logic that defines how the View looks and behaves. A view in Angular refers to a template (HTML).According to Team Angular, A…
Read More

Angular 11 Project Structure

Angular 11
[quads id=RndAds] Angular 11 Project Structure OverviewIn this tutorial we will see how angular project structure where we should add our logic, configuration etc.In our previous tutorial we created below project.I would recommend you the first file you should check out is README.md. It has some basic information on how to use CLI commands. For Example, ng new, ng generate, ng build command etc.README.md: File containing a description of our project. All the information which we would like to provide our users with before they start using our app.Root Filese2e/: e2e/ live the end-to-end tests. This is using of end-to-end tests. Its have its own ts.config file.node_modules/:Node.js creates this folder and puts all third-party modules listed in package.json inside of it. When you install any third party modules or packages…
Read More

Setup Angular Environment

Angular 11
[quads id=RndAds] Setup Angular EnvironmentIn this tutorial will discuss how to setup environment and create our first angular 11 applicationTools and Software Require to setup envTo get started with the installation, we first need to make sure we have nodejs and npm installed with the latest version. The npm package gets installed along with nodejs.Go to the nodejs official site https://nodejs.org/en/ and download as per your requirement.The latest version of Nodejs v14.16.0 is recommended for users. Users who already have nodejs greater than 14.16.0 can skip the above process. Once nodejs is installed, you can check the version of node in the command line using the command.Next tool we require VSCode, We will use Visual Studio Code IDE for working with Angular 11; you can use any IDE, i.e., Atom,…
Read More

Introduction to Angular 11

Angular 11
[quads id=RndAds] Introduction to Angular 11In this tutorial we discuss what's new in angular 11 and understand below concepts.What is angularWhat is angular history or versionWhat are the advantages of angularWhat are the new features in angular 11.Angular.Angular is a platform and framework for building single-page client applications using HTML and TypeScript.A single page application is a web application or a website which provides users a very fluid, reactive and fast experience similar to a desktop application. It contains menu, buttons and blocks on a single page and when a user clicks on any of them; it dynamically rewrites the current page rather than loading entire new pages from a server. That's the reason behind its reactive fast speed.Angular 2 is complete rewrite of AngularJS and its written in TypeScript.…
Read More

Entity Framework Core Querying to Database

Entity Framework Core
[quads id=RndAds] Entity Framework Core Query to Database.In this tutorial will discuss to write queries into entity framework core and below point and querying entity framework core.Entity Framework Core uses Language Integrated Query (LINQ) to query data from the database.LINQ allows you to use C# (or your .NET language of choice) to write strongly typed queries based on your derived context and entity classes.Querying in Entity Framework Core remains the same as in EF 6 to load entities from the database.It provides more optimized SQL queries and the ability to include C#/VB.NET functions into LINQ-to-Entities queries.Step 1: Create interface 'IStudentContract.cs'.public interface IStudentContract { Student GetStudent(int id); List GetAllStudent(); List GetAllStudentByName(string name); }Step 2: Create service 'StudentService.cs' which impments the above contract.public class StudentService : IStudentContract { public List GetAllStudent() { throw…
Read More

Database First Approach

Entity Framework Core
[quads id=RndAds] Database First Approach.In this tutorial will see how to create model from database in entity framework core and will see implementation database first approach in entity framework core.The Database First Approach creates the entity framework from an existing database. We use all other functionalities, such as the model/database sync and the code generation, in the same way we used them in the Model First approach.The Database First Approach provides an alternative to the Code First and Model First approaches to the Entity Data Model. It creates model codes (classes, properties, DbContext etc.) from the database in the project and those classes become the link between the database and controller.So lets create database and table require.We have a simple database created in the previous article, and it contains two…
Read More

Code First Approach

Entity Framework Core
[quads id=RndAds] Code First ApproachIn this tutorial we discuss what code first approach in entity framework core and generate database from out domain entity.Entity Framework introduced the Code-First approach with Entity Framework 4.1. Code-First is mainly useful in Domain Driven Design. In the Code-First approach, we will focus on the domain of your application and start creating classes for your domain entity rather than design your database first and then create the classes which match your database design.We will create Entities, which are regular C# classes with DB attributes. Entities are not “DTO” objects because it's designed for Database interactions. We will be using the code-first approach, so these Entity classes are inputs for DB creation.Step 1: Let create folder with name entity in our project into root directory and…
Read More