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:
{% for rank in ranks %} | |
{% if rank.person.id == person.id %} | |
<td>{{rank.get_rank_display}}</td> | |
<td>{{rank.start_date}}</td> | |
{% elif forloop.last %} | |
<td></td> | |
<td></td> | |
{% endif %} | |
{% endfor %} |
<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> |
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; |
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; | |
}); | |
} |
//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 => { |
I hereby claim:
To claim this, I am signing this object:
This page is no longer updated. You can view the latest information on my website. Thanks!
People Impacted: 51,428
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 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) { |