Error:
ng is not recognized as valid command even after successful npm install
Path:
C:\Users\{UserName}\appdata\Roaming\npm
C#.Net, VB.Net, ASP.Net, SQL Server, Mobile Programming, DevOps, Gardening, DIY


1: function showAlert1()
2: {
3: alert("testing combining and compression");
4: }
1: function showAlert2()
2: {
3: alert("testing combining and compression");
4: }
1:
2: #defining version
3: $version = "1.0";
4:
5: #creating new file. "-force" replaces new file if file already exists
6: New-Item "CustomJS-$version.js" -type file -force
7: New-Item "CustomJS-$version.min.js" -type file -force
8:
9: # Getting content from multiple custom JS files and put into a single version file.
10: # if your custom JS files and output files located in same directory, you have to exclude the output files. Otherwise you get access denied error.
11: Get-Content "Custom*.js" -Exclude "CustomJS-$version.js", "CustomJS-$version.min.js" | Add-Content "CustomJS-$version.js"
12:
13: #compressing JS files using Yahoo UI Compressor JAR file
14: java -jar yuicompressor-2.4.8pre.jar "CustomJS-$version.js" -o "CustomJS-$version.min.js"
1: function showAlert1()
2: {
3: alert("testing combining and compression");
4: }
5: function showAlert2()
6: {
7: alert("testing combining and compression");
8: }
1: function showAlert1(){alert("testing combining and compression")}function showAlert2(){alert("testing combining and compression")};
1: #defining version
2: $version = "1.0";
3:
4: #creating new file. "-force" replaces new file if file already exists
5: New-Item "CustomCSS-$version.css" -type file -force
6: New-Item "CustomCSS-$version.min.css" -type file -force
7:
8: # Getting content from multiple custom CSS files and put into a single version file.
9: # if your custom CSS files and output files located in same directory, you have to exclude the output files. Otherwise you get access denied error.
10: Get-Content "Custom*.css" -Exclude "CustomCSS-$version.css", "CustomCSS-$version.min.css" | Add-Content "CustomCSS-$version.css"
11:
12: #compressing CSS files using Yahoo UI Compressor JAR file
13: java -jar ..\JAR\yuicompressor-2.4.8pre.jar "CustomCSS-$version.css" -o "CustomCSS-$version.min.css"
private void HyperlinkButton_Click_1(object sender, RoutedEventArgs e)
{
NavigationService.Navigate(new Uri("/Page1.xaml", UriKind.Relative));
}
private void HyperlinkButton_Click_1(object sender, RoutedEventArgs e)
{
NavigationService.GoBack();
}
private void Button_Click_1(object sender, RoutedEventArgs e)
{
NavigationService.Navigate(new Uri("/Page1.xaml?name=" + txtName.Text, UriKind.Relative));
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
string name = string.Empty;
if (NavigationContext.QueryString.TryGetValue("name", out name))
txtBox1.Text = name;
}
a) $("#content").off(); // unbind all the events of that control.
b) $("#content").empty(); or $("#content").html(""); // -- Remove the child elements before removing the element itself.
c) $("#content").remove(); // -- remove the element itself.
delete x; // x is variable
x = null;
[object].sortable = null;
<div>
<a id="atest" style="cursor:pointer" onclick="showAlert1();"> Click to fire an event</a>
</div>
<script type="text/javascript">
$(function () {
$("#atest").attr("onclick", "showAlert1();showAlert2();");
});
function showAlert1()
{
alert("Alert 1");
}
function showAlert2() {
alert("Alert 2");
}
</script>
Above jQuery, replacing the onclick attribute to show the two alert instead of single alert. This code won't work in IE 7/8 browser. To fix this, you can bind a custom click event using click method in jQuery.
<script type="text/javascript">
$(function () {
$("#atest").click(function () { showAlert1(); showAlert2(); });
});
function showAlert1()
{
alert("Alert 1");
}
function showAlert2() {
alert("Alert 2");
}
</script>
<script type="text/javascript">
$(function () {
var onc = $("#atest").attr("onclick");
var elemHTML = $("#atest").parent().html();
var finalElement = elemHTML.replace(onc, onc + "showAlert2();");
$("#atest").parent().html(finalElement);
});
function showAlert1()
{
alert("Alert 1");
}
function showAlert2() {
alert("Alert 2");
}
</script>
String address = "Jawaharlal Nehru Rd Kasi Estate Jafferkhanpet Chennai Tamil Nadu";
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=" + address));
context.startActivity(intent);
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<Button
android:id="@+id/btnGoogleMap"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:text="Google Map" />
</RelativeLayout>
import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class GoogleMapActivity extends Activity {
final Context context = this;
Button btnGoogleMap;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.google_map);
btnGoogleMap.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
String address = "Jawaharlal Nehru Rd Kasi Estate Jafferkhanpet Chennai Tamil Nadu";
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=" + address));
context.startActivity(intent);
}
}
);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.google_map, menu);
return true;
}
}
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ayyanar.helloworld"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".GoogleMapActivity"
android:label="@string/title_activity_google_map" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
webView = (WebView) findViewById(R.id.webView1);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("http://ayyanar.blogspot.com");
<uses-permission android:name="android.permission.INTERNET" />
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:padding="@dimen/padding_medium"
android:text="@string/hello_world"
tools:context=".WebViewActivity" />
<WebView
android:id="@+id/webView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true" />
</RelativeLayout>
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.webkit.WebView;
public class WebViewActivity extends Activity {
WebView webView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.web_view);
webView = (WebView) findViewById(R.id.webView1);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("http://ayyanar.blogspot.com");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.web_view, menu);
return true;
}
}
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ayyanar.helloworld"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".WebViewActivity"
android:label="@string/title_activity_web_view" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>