title: How to use sweetalert2 in angular2
body: <p>Getting this error after npm start in angular project.</p>
  
  <blockquote>
    <p>app/app.component.ts(12,7): error TS2304: Cannot find name 'swal'.
    app/app.component.ts(21,7): error TS2304: Cannot find name 'swal'.</p>
  </blockquote>
  
  <p>I created an angular project. Inside app.component.ts I added sweet alert  code </p>
  
  <pre><code>export class AppComponent {
  deleteRow() {
        swal({
        title: 'Are you sure?',
        text: "You won't be able to revert this!",
        type: 'warning',
        showCancelButton: true,
        confirmButtonColor: '#3085d6',
        cancelButtonColor: '#d33',
        confirmButtonText: 'Yes, delete it!'
      }).then(function() {
        swal(
          'Deleted!',
          'Your file has been deleted.',
          'success'
        );
      })
    }
  }
  </code></pre>
  
  <p>I did </p>
  
  <pre><code>npm install sweetalert2 --save 
  </code></pre>
  
  <p>and also added the path in index.html</p>
  
  <pre><code>&lt;script src="node_modules/sweetalert2/dist/sweetalert2.min.js"&gt;&lt;/script&gt;
  &lt;link rel="stylesheet" type="text/css" href="node_modules/sweetalert2/dist/sweetalert2.css"&gt;
  </code></pre>