Dan Scott (dscott@laurentian.ca)
Associate Librarian, Chair of the Library & Archives, Systems Librarian, …
March 24, 2017
"The npm registry hosts almost half a million packages of free, reusable code — the largest software registry in the world." https://www.npmjs.com/
package.json
lists the packages your project depends onnpm install
downloads those packages and their dependenciespackage.json
are not just for nodejs:
grunt serve
Grunt | Gulp | |
---|---|---|
File name | Gruntfile.js | gulpfile.js |
Format | JSON | JavaScript |
Goals | Building, testing, deploying packages |
It's really a wash...
<meta name="viewport">
attribute<meta name="viewport"
content="width=device-width, initial-scale=1">
<style>
.menu { width: 100% }
.facet_sidebar {
display: none;
}
@media (min-width: 600px) {
.facet_sidebar {
display: block;
}
}
</style>
manifest.json
makes a web app installable{
"name": "Forest VR",
"icons": [{
"src": "./images/icon-144x144.png",
"sizes": "144x144",
"type": "image/png"
}],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"start_url": "./index.html",
"display": "standalone",
"orientation": "landscape"
}
Intro to Progressive Web Apps (Udacity)
You know, in all your spare time…
npm install -g @angular/cli
ng new hello-world
cd hello-world
ng serve
ng eject --aot -pr
webpack -p
Encapsulation of properties, style, and behaviour
import { Component, Input } from '@angular/core';
import { Faculty } from './faculty';
@Component({
selector: 'faculty-detail',
styleUrls: [ './faculty-detail.component.css' ],
template: `
<div *ngIf="faculty">
<h2>{{faculty.name}} details!</h2>
<div><label>id: </label>{{faculty.id}}</div>
<div>
<label>name: </label>
<input [(ngModel)]="faculty.name" placeholder="name"/>
</div>
</div>
`
})
export class FacultyDetailComponent {
@Input() faculty: Faculty;
}
Routes map URL paths and parameters to components
{
path: 'detail/:id',
component: FacultyDetailComponent
},
npm install -g create-react-app
create-react-app hello-world
cd hello-world
npm start
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License