I hereby claim:
- I am pjlamb12 on github.
- I am pjlamb12 (https://keybase.io/pjlamb12) on keybase.
- I have a public key ASDSwRAtv2HhIo1JyOuZe-QXS4G-9dxyH0bhwZANe0vhYwo
To claim this, I am signing this object:
<ul class="search-results" ng-show="searchKeyword != '' && inputIsFocused"> | |
<li ng-repeat="provider in providerList | searchFilter:searchFilterType:searchKeyword" ng-class="{'highlighted': provider == arrowSelectedItem}" ng-click="setSearchKeyword(provider)">{{provider.name}}</li> | |
</ul> |
//Component Declaration | |
export class ChildComponent { | |
@Output() onOutputEvt: EventEmitter<any> = new EventEmitter<any>(); | |
onTestOutputButtonClick() { | |
this.onOutputEvt.emit({data: 'Emitted data'}); | |
} | |
makeAnUpdate(form) { | |
this._service.makeDbCall(data).subscribe(result => { |
function update(args, done) { | |
Model.update([{id: args.id}, {id2: args.id2}], [{field1: args.field1}, {field2: args.field2}]).exec(function(err, updatedModel) { | |
console.log('error on update: ', err); | |
console.log('updated model: ', updatedModel); | |
return updatedModel; | |
}); | |
} |
import {Injectable, NgZone} from 'angular2/core'; | |
import {Http, Response, Headers} from 'angular2/http'; | |
import {Router} from 'angular2/router'; | |
import {tokenNotExpired} from 'angular2-jwt'; | |
import 'rxjs/add/operator/map'; | |
import {AppConfig} from '../services/config'; | |
declare var Auth0Lock: any; |
I hereby claim:
To claim this, I am signing this object:
ng build --prod --output-hashing=none && cat dist/ng-elements/runtime.js dist/ng-elements/polyfills.js dist/ng-elements/scripts.js dist/ng-elements/main.js > ../demo/ngelements.js |
The next Angular item we’ll test is a component. This is going to be very similar to the directive we just tested. But, even though it’ll look almost the exact same, I think it’ll be worth going through the exercise of testing the component.
This component’s purpose is to display a list of alerts that we want to show to our users. There is a related service that adds and removes the alerts and passes them along using a Subject
. It is slightly complicated because we’re going to use a TemplateRef
to pass in the template that the ngFor
loop should use for the alerts. That way the implementing application can determine what the alerts should look like. Here’s the component:
@Component({
selector: 'alerts-display',
template: '<ng-template ngFor let-alert [ngForOf]="alerts$ | async" [ngForTemplate]="alertTemplate"></ng-template>',
styleUrls: ['./alerts-display.component.scss'],
})
const bookList = [['Book 1', 'some Author'], ['Book 2', 'some Author'], ['Book 3', 'some Author']]; | |
const ratingList = [[0, 3, 5], [3, 0, 5]]; | |
const nameList = ['Preston', 'Blake']; | |
function getRatings() { | |
let personIndex = 0; | |
const returnObj = {}; | |
while (personIndex < nameList.length) { |
const angularJson = require('./angular.json'); | |
const exec = require('child_process').exec; | |
const fs = require('fs'); | |
const mainProjects = Object.keys(angularJson.projects).filter(proj => !proj.includes('e2e')); | |
const tsConfigPaths = parseTsconfigPaths(); | |
function parseTsconfigPaths() { | |
const pathsArray = []; | |
for (const projectName of mainProjects) { |
pdf_book: | |
pandoc_args: --listings | |
includes: | |
in_header: preamble.tex |