On Github mdoleh / AngularComparison
Presented by Mohammad Doleh & Ryan Wittibschlager
@Component({
templateUrl: 'zippy.html',
styles: [`
.zippy {
background: green;
}
`],
encapsulation: ViewEncapsulation.Native
})
Your favorite hero is: {{vm.favoriteHero}}
Your favorite hero is: {{favoriteHero}}
{{movie.title | uppercase}}
{{movie.title | uppercase}}
<tr ng-repeat="movie in vm.movies">
<td>{{movie.title}}</td>
</tr>
<tr *ngFor="let movie of movies">
<td>{{movie.title}}</td>
</tr>
<body ng-app="movieHunter">
import { bootstrap } from '@angular/platform-browser-dynamic';
import { AppComponent } from './app.component';
bootstrap(AppComponent);
<div ng-class="{active: isActive}">
<div ng-class="{active: isActive,
shazam: isImportant}">
<div [ngClass]="{active: isActive}">
<div [ngClass]="{active: isActive,
shazam: isImportant}">
<div [class.active]="isActive">
<button ng-click="vm.toggleImage()"> <button ng-click="vm.toggleImage($event)">
<button (click)="toggleImage()"> <button (click)="toggleImage($event)">
myApp.controller('GreetingController',
['$scope', function($scope) {
$scope.greeting = 'Hola!';
}]);
@Component({
selector: 'movie-list',
templateUrl:'app/movie-list.component.html',
styleUrls: ['app/movie-list.component.css'],
pipes: [StringSafeDatePipe],
providers: [SerializerService],
directives: [FORM_DIRECTIVES]
})
export class MovieListComponent {
this.greeting = 'Hola!';
}
<table ng-if="movies.length">
<table *ngIf="movies.length">
<input ng-model="vm.favoriteHero"/>
<input [(ngModel)]="favoriteHero" />
beforeEach(module('myApp'))
inject(function(_$controller_, ...)...
$controller('PasswordController', { $scope: $scope })
$filter('length')
$provide.value('myService', myMockedService)
var scope = $rootScope.$new();
var element = $compile("<div my-directive></div>")(scope);
scope.$digest();
import {BacService} from '../src/BacService';
beforeEach(() => {
mockSerializer = jasmine.createSpyObj("SerializerService", ["getData", "storeData"]);
bacService = new BacService(mockSerializer);
});