Angular CLI New Project and Component

  1. Creating New Project Options:

1

Details Here

2. If you see the project did not created the templete as seperate html file, open angular.json file and setup these 2 line to false like this:

“schematics”: {
“@schematics/angular:component”: {
“inlineTemplate”: false,
“inlineStyle”: false
3. cd to inside the project.

 

4. Adding New Component:

ng g c test2

 

The type ‘System.Data.Entity.DbContext’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘EntityFramework 2

  1. Go to Tools » NuGet Package Manager » Manage NuGet Packages For Solution.
  2. Ensure that Browse is selected and type “entityframework” into the search box. and install the entity framework

Check if its exist in package.config <package id=”EntityFramework” version=”6.2.0″ targetFramework=”net461″ /> exist

Setup Angular 2 Environment in a NEW Computer

  1. Video tutorial: https://www.youtube.com/watch?v=H9iK2Eib85E
  2. Check which version of OS you have by start–>run–>msinfo32
  3. 12
  4. Download & install 64 bit Node from https://nodejs.org/en/download/
  5. after install, check it using cmd as administrator by running it: node -v
  6. You have to have VS 2015 update 3 (Minimum)
  7. VS 2015–>Tools Option–>organize the options like here:
  8. 3.PNG
  9. Install TypeScript for Visual Studio 2015 (Latest version) from https://www.microsoft.com/en-us/download/details.aspx?id=48593.
  10. Install Angular CLI by typing in cmd: npm install -g @angular/cli
  11. Download VS Code from https://code.visualstudio.com/download
  12. Create New Project using CMD: ng new TestProject1 –skip-tests true
  13. Once creating complete, Change Directory : cd C:\app\Angular
  14.  When you are inside the project folder: open the project using VS Code:

 

Winform – Override textbox to show sample text and clear on click

Winform watermark text on textbox:

 

public string initTextClient = “Client”;
public bool editedClient;

public SelectMatterClient()
{
InitializeComponent();

txtClient.Text = initTextClient;
txtClient.ForeColor = Color.Gray;

}

 

private void txtClient_KeyPress(object sender, KeyPressEventArgs e)
{
editedClient = !char.IsControl(e.KeyChar);
}

private void txtClient_Enter(object sender, EventArgs e)
{
if (!editedClient)
{
txtClient.Clear();
txtClient.ForeColor = Color.Black;
}
}

private void txtClient_Leave(object sender, EventArgs e)
{
if (!editedClient)
{
txtClient.Text = initTextClient;
txtClient.ForeColor = Color.Gray;
}
}Capture

deploy web service to IIS

Build your VS solution and copy the published files to a specific folder.

and add a new website in IIS and set the destination to that folder

Change connect as your authentication details to that folder and test settings.

Change the App pool to asp.net 4

You are good to go 🙂

1

By simplemsexchange Posted in ASP.NET