angular4

Is the AOT Compilation the default on angular@4.0.0?

别说谁变了你拦得住时间么 提交于 2019-12-18 13:29:15
问题 Is the AOT Compilation the default on angular@4.0.0 and angular/cli@1.0.0 ? We are migrating our apps today, and i don't know wheter its docs are still valid: https://angular.io/docs/ts/latest/cookbook/aot-compiler.html I'm having some issues that appears with AoT Compilations errors like that: Property 'myModel' is private and only accessible within class 'MyComponent'. ps.: It's error only appears with ng build -target=production I think wich this kind of error should not occurs on JIT

what are the differences between angular2 and angular4 [duplicate]

我是研究僧i 提交于 2019-12-18 11:41:14
问题 This question already has answers here : What is Angular 4 and from where I can learn more about it? (6 answers) Closed 2 years ago . can you please let me know the differences between angular2 and angular4. We know that there is a drastic change between angular1 and angular2. Is it repeated again for angular4. 回答1: There is nothing path breaking between angular 2 and angular 4 like angular 1 and angular 2. They are just doing it to maintain SEMVER(Sementic Versioning). Angular 2 is stable

Angular 2 - How to set animations on a Directive?

亡梦爱人 提交于 2019-12-18 02:49:27
问题 I have a Directive I can put on elements that checks the current scroll position of the element in question. Looks like this: @Directive({ selector: '[my-scroll-animation]' }) Whenever the position satifies a certain treshold, I want the element to appear on screen using an animation. I know that for a Component I can attach an animations property along with some settings in the host property to activate the animation. I would like something like this: import { myScrollAnimation } from '.

Angular Get queryParam from URL when no name is specified

怎甘沉沦 提交于 2019-12-12 06:51:34
问题 How do you get query information from a URL like this: http://localhost:4200/reset?c564e265451e2e24be460f30271678b566d20fa9962000063bb6d079f5e376a0= If it was http://...reset?token=c56... I can grab the value using queryParams by doing something like: this.route.queryParams.subscribe((params)=>this.token = params['token']);` but I can't figure out how to get the token when the query parameter has no name. I can see the value under _value when logging this.route.queryParams to the console. 回答1

sass multiple themes in angular

廉价感情. 提交于 2019-12-11 05:49:19
问题 Let's say I have two themes (light & dark) in an angular app > 2, and a toggle button which is already configured to add the theme class to the body tag variables.scss $themes: ( light: ( backgroundColor: #fff, textColor: #408bbd, borderColor: #254fe5, ), dark: ( backgroundColor: #222, textColor: #ddd, borderColor: #2e4dd2, ), ); I tried different approaches I found (here and here), but none worked. I also tried the simplest approach about.component.scss .theme-dark .page-title{ color: white;

angular 4 animations - transition duration is not applied

给你一囗甜甜゛ 提交于 2019-12-11 02:46:28
问题 what am I doing wrong? The transition happens but it's instant. The time set in animate function is not being applied trigger('showMenu', [ state('active', style({ marginLeft: '0px' })), state('inactive', style({ marginLeft: '-230px' })), transition('inactive => active', animate('2s')), transition('active => inactive', animate('2s')) ]) <div [@showMenu]="showMenuState" id="menu-side-wrapper"> MENU <div id="close-menu"> CLOSE </div> </div> 回答1: I've checked the code you've pasted here and it

How hide and show in angular 4.0

六眼飞鱼酱① 提交于 2019-12-10 14:55:23
问题 I am trying to toggle menu in angular 4. I have 2 separate components. One is for header layout and second one is for menu list. I have written toggle function on click of icon in the header layout and I am trying to hide and show the menu list. But this is not working for me. Following are my code: app.navbarComponent.html file: <header id='sv_header'> <div class='row'> <div class='col-lg-4 col-md-4 col-sm-4 col-xs-4 col'> <a href='' class='logo'> <img src='{{ logo }}' alt='Savaari' /> </a>

Angular 2 Testing: Get Value from ngModel

坚强是说给别人听的谎言 提交于 2019-12-10 10:59:21
问题 I'm trying to write a test that asserts on Angular's ngModel attribute. At this point, I can easily test the label. However, I am not able to select the value from ngModel Question What is the best way to get the value from ngModel ? HTML: <div name="customerName"> <label>Customer Name: </label> <div> <input type="text" class="form-control" [ngModel]="customer.name" asInline disabled /> </div> </div> Test it('bindings', () => { fixture = TestBed.createComponent(CustomerComponent); fixture

ng-bootstrap ngbDropdown not working in angular 4

余生颓废 提交于 2019-12-07 08:27:13
问题 At my angular 4 application is the ngbDropdown-Element from ng-bootstrap not working. I have installed the following npm modules for this case: "@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.22", "bootstrap": "4.0.0-alpha.6", "bootstrap-sass": "^3.3.7", My app.module.ts is looking like this: import { BrowserModule } from "@angular/platform-browser" import { NgModule } from "@angular/core"; import { FormsModule } from "@angular/forms"; import { HttpModule } from "@angular/http"; import {

Angular pre-bootstrap (first screen) loader's animation freezes during initial loading

久未见 提交于 2019-12-07 05:33:12
问题 Simple demo here: https://plnkr.co/edit/IA0Bs5VH9WwVbLlKPQ6X?p=preview (I used the official angular.io/docs demo app) The problem is: the first screen loader (I used loader.svg) animation freezes for a second during the initial loading of Angular App The process goes like this: open the page, svg loader animation starts -> loader animation freezes -> loader animation re-starts -> angular app finish loading, loader hided In this demo, the freeze is more obvious: http://iarouse.com/dist