Giter Site home page Giter Site logo

webcat12345 / ngx-ui-switch Goto Github PK

View Code? Open in Web Editor NEW
110.0 3.0 67.0 4.81 MB

Angular UI Switch component

Home Page: https://webcat12345.github.io/ngx-ui-switch/demo/

License: MIT License

TypeScript 61.06% HTML 23.09% JavaScript 2.17% SCSS 11.44% Shell 2.25%
angular ngx-ui-switch ngx angular-cli ui-switch switch ng angular-ui-switch

ngx-ui-switch's Introduction

Angular UI Switch Component

Gitter Build Status GitHub Pages license npm version npm

All Contributors

Open in StackBlitz

Description

This is a simple iOS 7 style switch component for Angular.

alt

Inspired by switchery in Angular.

Installation

npm: npm install ngx-ui-switch --save

yarn: yarn add ngx-ui-switch

Some features are not available in previous versions:

  • CSS styling
  • Switch content (checkedLabel, uncheckedLabel) #309 #343
  • Global options
  • beforeChange event #314 #359

Usage

  • Import into a module (AppModule example below)
// app.module.ts
import { UiSwitchModule } from 'ngx-ui-switch';
import { AppComponent } from './app.component';

@NgModule({
  imports: [BrowserModule, UiSwitchModule],
  declarations: [AppComponent],
  bootstrap: [AppComponent]
})
export class AppModule {}
  • Add default css file to appropriate project(s) angular.json
"styles": [
  "src/styles.css",
  "./node_modules/ngx-ui-switch/ui-switch.component.css"
]

Alternatively, the scss version can be imported into a scss file:

@import '~ngx-ui-switch/ui-switch.component.scss';

Global config

Use when you want to change default values globally.

These settings will override anything passed in via property bindings.

import { UiSwitchModule } from 'ngx-ui-switch';
import { AppComponent } from './app.component';

@NgModule({
  imports: [
    BrowserModule,
    UiSwitchModule.forRoot({
      size: 'small',
      color: 'rgb(0, 189, 99)',
      switchColor: '#80FFA2',
      defaultBgColor: '#00ACFF',
      defaultBoColor : '#476EFF',
      checkedLabel: 'on',
      uncheckedLabel: 'off'
    })
  ],
  declarations: [AppComponent],
  bootstrap: [AppComponent]
})
export class AppModule {}
<ui-switch></ui-switch>

Note that if you are using the switch in a child NgModule, such as a lazy loaded module, then you must also import the module in the module itself or within a shared module. Otherwise you will get the error that it is an unknown component as seen in issue #227.

Two way binding

<ui-switch [(ngModel)]="enable"></ui-switch>

Params

checked

type: boolean

default: false

<ui-switch checked></ui-switch>
<ui-switch [checked]="false"></ui-switch>

disabled

type: boolean

default: false

<ui-switch disabled></ui-switch>
<ui-switch checked [disabled]="true"></ui-switch>

loading

Show a loading state for the toggle button when true. Often utilized with beforeChange.

type: boolean

default: false

<ui-switch [loading]="isLoading">
  <i class="fa fa-spinner fa-pulse" *ngIf="isLoading"></i>
</ui-switch>

change

type: boolean

default: noop

<ui-switch (change)="onChange($event)"></ui-switch>

changeEvent

type: MouseEvent

default: noop

<ui-switch (changeEvent)="onChangeEvent($event)"></ui-switch>
<ui-switch (changeEvent)="$event.stopPropagation()"></ui-switch>

valueChange

type: boolean

default: noop

<ui-switch (valueChange)="onValueChange($event)"></ui-switch>

beforeChange

Utilize an observable to check that the toggle event should complete

type: Observable<boolean>

default: noop

<ui-switch [beforeChange]="OnBeforeChange">
</ui-switch>
OnBeforeChange: Observable<boolean> = new Observable((observer) => {
  const timeout = setTimeout(() => {
    observer.next(true);
  }, 2000);
  return () => clearTimeout(timeout);
});

size

type: string

default: medium

<ui-switch size="small"></ui-switch>
<ui-switch size="large"></ui-switch>

reverse

type: boolean

default: false

<ui-switch reverse></ui-switch>

color

type: string

default: rgb(100, 189, 99)

<ui-switch color="red"></ui-switch>

switchColor

type: string

default: #fff

<ui-switch switchColor="#fcfcfc"></ui-switch>

defaultBgColor

Default background color

type: string

default: #fff

<ui-switch defaultBgColor="red"></ui-switch>

defaultBoColor

Default border color

type: string

default: #dfdfdf

<ui-switch defaultBoColor="black"></ui-switch>

checkedLabel

Checked label (on)

type: string

default: null

<ui-switch checkedLabel="on"></ui-switch>

uncheckedLabel

Unchecked label (off)

type: string

default: null

<ui-switch uncheckedLabel="off"></ui-switch>

checkedTextColor

checked text color of the label (on)

type: string

default: black

<ui-switch checkedTextColor="#7CFC00"></ui-switch>

uncheckedTextColor

Unchecked text color of the label (off)

type: string

default: black

<ui-switch uncheckedTextColor="red"></ui-switch>

Switch Content

<ui-switch uncheckedLabel="off">
  <img src=""/>
</ui-switch>

Aria Label

<ui-switch [ariaLabel]="'labelName'"></ui-switch>

Development

Setup

yarn install

Demo

Edit files in src/app to add to the demo or try changes to the library.

Build library

First, edit version in package.json and src/lib/package.json to publish a new version to npmjs.org

# Build the library into dist/{es5,es2015}
yarn build
# Publish to npm
yarn release

Contributors

Thanks goes to these wonderful people (emoji key):

webcat_black
webcat_black

💻 🎨 💡 🤔 👀
Chris McKnight
Chris McKnight

💬 💻 📖 🤔 🚇 🔌 👀 🔧
Jakub
Jakub

💻 📖
Serhii Kovalenko
Serhii Kovalenko

💻 💡 📦
Richard McSharry
Richard McSharry

📖
bitsprint
bitsprint

🚇 📦 🔧
Gianluca Paronitti
Gianluca Paronitti

💻
Milos Bejda
Milos Bejda

💻 📖 💡
kameelyan
kameelyan

💻 📖 💡
Grégory Alary
Grégory Alary

💬 🐛 💻 🎨
zehtravassos
zehtravassos

💻 🎨
H. Rüger
H. Rüger

🐛 💻 🚧

This project follows the all-contributors specification. Contributions of any kind welcome!

ngx-ui-switch's People

Contributors

bitsprint avatar bjorn-einar-bjartnes-4ss avatar blazekv avatar cmajsmith avatar cmckni3 avatar gparonitti avatar greenkeeper[bot] avatar greenkeeperio-bot avatar gregoryalary avatar hrueger avatar kubiq avatar mibmo avatar miguelcanot avatar pcshah1996 avatar pliashkou avatar renovate-bot avatar renovate[bot] avatar rmcsharry avatar snyk-bot avatar webcat12345 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ngx-ui-switch's Issues

Error: Cannot find module 'ngx-ui-switch/src' in angular-cli with angular universal

Its working with angular cli, but after converting my project to angular cli with angular universal. its showing the error
Error: Cannot find module 'ngx-ui-switch/src'

    throw err;
    ^
   Error: Cannot find module 'ngx-ui-switch/src'
    at Function.Module._resolveFilename (module.js:469:15)

using :
"ngx-ui-switch": "^1.3.5",
import { UiSwitchModule } from 'ngx-ui-switch/src';
@NgModule({
imports: [UiSwitchModule]
......
})

Globally setting labels does not work (7.0.0)

I can set labels on individual switches in a template, but when I try to set them globally they are ignored:

    UiSwitchModule.forRoot({
      color: '#cbffcb',
      switchColor: '#a69986',
      defaultBgColor: '#fff',
      defaultBoColor: '#ab9885', 
      checkedLabel: 'Yes',
      uncheckedLabel: 'No'      
    }),

Cannot install through NPM

Trying to install using command:
npm install ngx-ui-switch --save

gets the error:

npm ERR! path C:\Projects\FormsDesigner\node_modules\ngx-ui-switch
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Projects\FormsDesigner\node_modules\ngx-ui-switch' -> 'C:\Projects\FormsDesigner\node_modules.ngx-ui-switch.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users_USER_NAME_\AppData\Roaming\npm-cache_logs\2017-06-30T13_33_06_207Z-debug.log

The complete log relevant section is this exact same message.

Metadata version mismatch for module

I'm trying to integrate it with my angular4 app with below dependencies:

"dependencies": { "@angular/animations": "^4.0.0", "@angular/common": "^4.0.0", "@angular/compiler": "^4.0.0", "@angular/core": "^4.0.0", "@angular/forms": "^4.0.0", "@angular/http": "^4.0.0", "@angular/platform-browser": "^4.0.0", "@angular/platform-browser-dynamic": "^4.0.0", "@angular/router": "^4.0.0", "ag-grid": "^14.2.0", "ag-grid-angular": "^14.2.0", "ag-grid-enterprise": "^14.2.0", "angular2-notifications": "^0.4.53", "bootstrap": "4.0.0-alpha.6", "core-js": "^2.4.1", "immutable": "^3.8.2", "jquery": "^3.2.1", "ngx-bootstrap": "^1.9.3", "ngx-ui-switch": "^1.3.0", "popper.js": "^1.12.9", "rxjs": "^5.1.0", "zone.js": "^0.8.4" },

But, I'm unable to build the project. Please find the error below:

ERROR in Metadata version mismatch for module C:/.../node_modules/ngx-ui-switch/index.d.ts, found version 4, expected 3, resolving symbol AppModule in C:/.../src/app/app.module.ts, resolving symbol AppModule in C:/.../src/main/webapp2.x/crossdock/src/app/app.module.ts

getting the same error with [email protected]

Any help would be appreciated.

Attribute `checked` is always set to `true`

Hey, great component here! 👍

I am trying to get the checked attribute to work for quite some time now, and looking at the source code it doesn't seem to be implemented?

The value is static and there is also no @Input() applied? Maybe I am getting this completely wrong, but no matter what I try the checked attribute always falls back to true.

An in-range update of webpack-dev-server is breaking the build 🚨

Version 2.4.5 of webpack-dev-server just got published.

Branch Build failing 🚨
Dependency webpack-dev-server
Current Version 2.4.4
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As webpack-dev-server is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details - ✅ **continuous-integration/travis-ci/push** The Travis CI build passed [Details](https://travis-ci.org/webcat12345/ngx-ui-switch/builds/226009628),- ❌ **continuous-integration/travis-ci/pr** The Travis CI build could not complete due to an error [Details](https://travis-ci.org/webcat12345/ngx-ui-switch/builds/227669756?utm_source=github_status&utm_medium=notification)

Commits

The new version differs by 4 commits0.

  • 662bc31 2.4.5
  • 99b273c Merge pull request #888 from phairoh/fix-incorrect-variable-usage
  • f26f985 Added tests for Server.prototype.checkHost
  • 9688eea Use idxPublic when extracting hostname from publicHost

false

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Option to turn off inline CSS

Hello. First of all thanks for all your work on this awesome component.

I'm currently working on a project that has a very strict Content Security Policy (has style-src set to 'self'), which totally blocks ngx-ui-switch display as it inserts inline styles.

So, the suggestion is to add an option that allows turning the inline CSS addition off, and let the controls rely on outer CSS-files rules only.

change event passes value and not the event

It seems from my usage that this:

<ui-switch (change)="onChange($event)"></ui-switch>

does not pass the $event, but actually $event.target.value. This means if I put the switch in a place where I don't want other clicks to be fired (stopPropagation of the event) I have to do this:

template

                  <ui-switch
                    [checked]="card.is_follow_up"
                    (click)="onIsFollowUpClicked($event)"
                    (change)="onIsFollowUpChanged($event)">
                  </ui-switch>

code

  public onIsFollowUpClicked($event: Event): void {
    $event.stopPropagation();
  }

  public onIsFollowUpChanged(value: boolean): void {
    this.card.is_follow_up = value;
}

I would expect the change event to pass the event, not the value?

An in-range update of @types/node is breaking the build 🚨

Version 8.0.5 of @types/node just got published.

Branch Build failing 🚨
Dependency @types/node
Current Version 8.0.4
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As @types/node is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Broken after upgrading from 6.0.3 to 6.1.1

I've updated my project to use version 6.1.1 (previously I had 6.0.3) and all switches disappeared with no errors in the console.

The <ui-switch> elements are still in the DOM but they have 0x0 dimensions.

Reverting to version 6.0.3 solves the issue for me.

An in-range update of webpack is breaking the build 🚨

Version 3.5.4 of webpack just got published.

Branch Build failing 🚨
Dependency webpack
Current Version 3.5.3
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As webpack is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build passed Details
  • continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error Details

Release Notes v3.5.4

Bugfixes

  • Warnings and errors contribute to hash, which shows stats on warning-only change
  • HMR: avoid crash when calling accept handler on disposed module
  • HMR: disable Scope Hoisting for modules using HMR
  • restore backwards compatibility of ConcatenatedModule (@kisenka)

Features:

  • Add option to limit the number of parallel processed modules (parallelism)
Commits

The new version differs by 22 commits.

  • 990563f 3.5.4
  • 2475c6a Merge pull request #5506 from webpack/bugfix/concat-hmr
  • 0ea37a5 Disallow Scope Hoisting when using HMR
  • 287d587 Merge pull request #5480 from kisenka/concatenated-module-in-3.5-compat
  • 3d272ac fix: restore modules property of ConcatenatedModule (fixes #5477)
  • 7a36951 Merge branch 'master' of https://github.com/webpack/webpack into concatenated-module-in-3.5-compat
  • 839915c Merge pull request #5501 from webpack/bugfix/hash-watch-warnings-errors
  • 93af585 fix stats tests
  • 3820157 fix lint problem
  • 0925a9d Merge pull request #5502 from webpack/feature/limit-processed-modules
  • 09c34cf remove hash from stats test with error
  • 930c019 fix validation output test
  • f9bf8a9 Limit the number of parallel processed modules
  • 7905bf5 Warnings and Errors contribute to hash
  • f7bcba7 Merge pull request #5500 from webpack/bugfix/hmr-disposed-handler

There are 22 commits in total.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

problem with angular 4.3x... Cannot find module 'ngx-ui-switch'

hi,

I'm getting the below error after npm i

ERROR in D:/PROJELER/2017/tps-hr/web/src/app/system/personnel/personnel.module.ts (7,32): Cannot find module 'ngx-ui-switch'.
ERROR in Error: Error encountered resolving symbol values statically. Could not resolve ngx-ui-switch relative to D:/PROJELER/2017/tps-hr/web/s
ymbol PersonnelModule in D:/PROJELER/2017/tps-hr/web/src/app/system/personnel/personnel.module.ts, resolving symbol PersonnelModule in D:/PROJE
dule.ts
at syntaxError (D:\PROJELER\2017\tps-hr\web\node_modules@angular\compiler\bundles\compiler.umd.js:1729:34)
at simplifyInContext (D:\PROJELER\2017\tps-hr\web\node_modules@angular\compiler\bundles\compiler.umd.js:25118:23)
at StaticReflector.simplify (D:\PROJELER\2017\tps-hr\web\node_modules@angular\compiler\bundles\compiler.umd.js:25130:13)
at StaticReflector.annotations (D:\PROJELER\2017\tps-hr\web\node_modules@angular\compiler\bundles\compiler.umd.js:24558:41)
at _getNgModuleMetadata (D:\PROJELER\2017\tps-hr\web\node_modules@angular\compiler-cli\src\ngtools_impl.js:138:31)
at _extractLazyRoutesFromStaticModule (D:\PROJELER\2017\tps-hr\web\node_modules@angular\compiler-cli\src\ngtools_impl.js:109:26)
at D:\PROJELER\2017\tps-hr\web\node_modules@angular\compiler-cli\src\ngtools_impl.js:129:27
at Array.reduce (native)
at _extractLazyRoutesFromStaticModule (D:\PROJELER\2017\tps-hr\web\node_modules@angular\compiler-cli\src\ngtools_impl.js:128:10)
at D:\PROJELER\2017\tps-hr\web\node_modules@angular\compiler-cli\src\ngtools_impl.js:129:27
at Array.reduce (native)
at _extractLazyRoutesFromStaticModule (D:\PROJELER\2017\tps-hr\web\node_modules@angular\compiler-cli\src\ngtools_impl.js:128:10)
at Object.listLazyRoutesOfModule (D:\PROJELER\2017\tps-hr\web\node_modules@angular\compiler-cli\src\ngtools_impl.js:53:22)
at Function.NgTools_InternalApi_NG_2.listLazyRoutes (D:\PROJELER\2017\tps-hr\web\node_modules@angular\compiler-cli\src\ngtools_api.js:91:3
at AotPlugin._getLazyRoutesFromNgtools (D:\PROJELER\2017\tps-hr\web\node_modules@ngtools\webpack\src\plugin.js:207:44)
at _donePromise.Promise.resolve.then.then.then.then.then (D:\PROJELER\2017\tps-hr\web\node_modules@ngtools\webpack\src\plugin.js:443:24)
at process._tickCallback (internal/process/next_tick.js:109:7)

An in-range update of ts-loader is breaking the build 🚨

Version 2.2.1 of ts-loader just got published.

Branch Build failing 🚨
Dependency ts-loader
Current Version 2.2.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ts-loader is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Release Notes v2.2.1
Commits

The new version differs by 7 commits.

  • c242ca8 Prepare for 2.2.1 release
  • b24d350 Speculative fix for #565 (#566)
  • 91a7edb Update CHANGELOG.md
  • bcbb3ce Report errors in JS(X) files when CheckJS is enabled (#564)
  • efe487f Update README.md
  • d7e37d2 Update README.md
  • 0440482 Drop node 7 from test matrix

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

ng 6

Allow upgrading to ng 6

Module parse failed

Hi,
I'm trying ngx-ui-switch 1.3.5 with Angular 4.1.3 and webpack 2.6.1.

In my shared.module I have:
import { UiSwitchModule } from 'ngx-ui-switch/src';
and I import and export it in that shared.module. I got the following error while building AOT:

ERROR in ./~/ngx-ui-switch/src/index.ts
Module parse failed: /[PATH]/node_modules/ngx-ui-switch/src/index.ts Unexpected character '@' (5:0)
You may need an appropriate loader to handle this file type.
| import { UiSwitchComponent } from './ui-switch.component';
| 
| @NgModule({
|     declarations: [UiSwitchComponent],
|     exports: [UiSwitchComponent]
 @ ./src/app/shared/shared.module.ts 45:0-51
...

Without AOT and by importing just from ngx-ui-switch instead of ngx-ui-switch/src - all builds and works fine. What am I missing?

Problem with angular universal

/home/XXX/Projects/XXXX/node_modules/ngx-ui-switch/src/index.ts:1
(function (exports, require, module, __filename, __dirname) { import { NgModule } from '@angular/core';
^^^^^^

SyntaxError: Unexpected token import
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Module._extensions..js (module.js:579:10)
at Object.require.extensions.(anonymous function) [as .ts] (/home/XXX/Projects/XXXX/node_modules/ts-node/src/index.ts:376:14)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)

MetaData version mismatch error with version 1.4.9

HI
With the latest version of [email protected] and angular 4 application I am getting metadata version mismatch error for this module

C:/mywork/Personnel/mystuff/thirdparty/engage/node_modules/ngx-ui-switch/index.d.ts, found versio
n 4, expected 3,

I am using angular cli 1.4.5 version.

can you please share the dependency (that now depends on Angular 5) to the prior version that is compatible with Angular 4. ?

Option to add text inside switch

I don't know if the ability to style the switch directly will allow this by perhaps doing :before or :after css rules and setting content property. But it would be nice to be able to just expose an optional property to add text like 'on/off' or 'yes/no' or 'in/out' for example.

See image

image

An in-range update of @types/jasmine is breaking the build 🚨

Version 2.5.53 of @types/jasmine just got published.

Branch Build failing 🚨
Dependency @types/jasmine
Current Version 2.5.52
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As @types/jasmine is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build passed Details
  • continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error Details

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of typescript is breaking the build 🚨

Version 2.4.1 of typescript just got published.

Branch Build failing 🚨
Dependency typescript
Current Version 2.4.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As typescript is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Release Notes TypeScript 2.4

For release notes, check out the release announcement

For new features, check out the What's new in TypeScript 2.4.

For breaking changes, check out the Breaking changes in TypeScript 2.4 page.

For the complete list of fixed issues, check out the fixed issues query for Typescript 2.4.

Download:

Commits

The new version differs by 141 commits.

  • 8b2fe13 Update LKG.
  • 14d95ed Test:Block-scoped definition of Promise works
  • a8846bf Skip block scope check with no error location
  • 44f2336 Merge pull request #16633 from Microsoft/release-2.4_fixIncrementalParsing
  • 4875a27 Add tests
  • 15ef20d Set the structureReused to be safemoudles when dynamic import change
  • 6d33083 Add tests
  • 11b9f6e Wip-fix incremental parsing
  • 2721fd4 In TypeScript code, never bind JSDoc normally, just set parent pointers (#16555) (#16561)
  • 0968ed9 Revert string enum changes (#16569)
  • 096f8cc Update LKG
  • 9241175 Allow running in strict mode (#16557)
  • f49b007 Update LKG
  • f1b0f59 Update version to 2.4.1
  • ed9cde9 Update LKG

There are 141 commits in total.

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

typescript build error

Hi,

First, thanks for the great component.
When building I am getting this error:

ERROR in ./~/ngx-ui-switch/src/index.ts Module build failed: Error: Typescript emitted no output for /Users/Fauzi/code/mx/maritimexchange/node_modules/ngx-ui-switch/src/index.ts. You should not need to recompile .ts files in node_modules. Please contact the package author to advise them to use --declaration --outDir. More https://github.com/Microsoft/TypeScript/issues/12358 at Object.loader (/Users/Fauzi/code/mx/maritimexchange/node_modules/ts-loader/dist/index.js:32:15) @ ./src/common/common.module.ts 22:12-40 @ ./src/app/app.module.ts @ ./src/main.ts @ multi (webpack)-dev-server/client?http://localhost:3000 ./src/main.ts Child html-webpack-plugin for "index.html": chunk {0} index.html 519 bytes [entry] webpack: Failed to compile.

Could you help please?

ERROR in UiSwitchModule is not an NgModule

I was previously running the angular2-ui-switch (https://www.npmjs.com/package/angular2-ui-switch).

I installed the ngx-ui-switch, changed my module to: import { UiSwitchModule } from 'ngx-ui-switch';

I get the same error as I did with the previous switchModule either trying to build or use WebPack: ERROR in UiSwitchModule is not an NgModule

Does this switch have any dependencies? Do I need to clear some cache thing perhaps?

ngModel' since it isn't a known property of 'ui-switch'

ngModel is not working properly.
Issue:
compiler.es5.js:1694 Uncaught Error: Template parse errors:
Can't bind to 'ngModel' since it isn't a known property of 'ui-switch'.

  1. If 'ui-switch' is an Angular component and it has 'ngModel' input, then verify that it is part of this module.

  2. If 'ui-switch' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

  3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.

         <ui-switch [ERROR ->][(ngModel)]="enable"></ui-switch>
       </div>
    
<ui-switch [(ngModel)]="enable"></ui-switch>
enable = true;

cannot find module 'ngx-ui-switch/src'

hi,

I got error as Unexpected module 'UiSwitchModule' while running ng build --prod which is working fine in ng serve.so that I imported ngx-ui-switch/src as per #15 (comment) .But I got cannot find module ngx-ui-switch/src error.

Thanks

set custom size

There are three options at the moment

  • small
  • medium
  • large

I think we need custom size in px.

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

problem with angular 5

Hi,

I'm getting the below error message from my angular 5.0 project.

Uncaught Error: Template parse errors:
Can't bind to 'ngOutletContext' since it isn't a known property of 'ng-template'.

  1. If 'ngOutletContext' is an Angular directive, then add 'CommonModule' to the '@NgModule.imports' of this component.
  2. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("

    <ng-template
    [ERROR ->][ngOutletContext]="{ item: model, index: index }"
    [ngTemplateOutlet]="template">
    "): ng:///TagInputModule/TagComponent.html@12:12
    Property binding ngOutletContext not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the "@NgModule.declarations". ("div *ngSwitchCase="true" [attr.contenteditable]="editing">

    [ERROR ->]<ng-template
    [ngOutletContext]="{ item: model, index: index }"
    [ngTemplateOut"): ng:///TagInputModule/TagComponent.html@11:8

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.