小编alp*_*rim的帖子

Xcode 9.2不支持iOS 11.3的Xcode需要9.3

显然,使用最新的IOS更新,由于以下错误,我的Xcode版本无法构建.

找不到设备支持文件.此iPhone 7 Plus(型号1661,1784,1785,1786)运行的是iOS 11.3(15E216),此版本的Xcode可能不支持此功能.

试图通过此链接https://developer.apple.com/download/more/安装Xcode 9.3 .但事实证明,我的Mac OS版本将更新视为不兼容的版本.在Sierra 10.12.6上运行

xcode ios xcode9.3

46
推荐指数
4
解决办法
6万
查看次数

rxjs 6属性'of'在类型'typeof Observable'上不存在

刚刚从rxjs 5/angular 5移动到rxjs 6/angular 6,经历了这个迁移指南.似乎无法弄清楚现在应该是什么,任何帮助表示赞赏.

import { Observable, of } from 'rxjs';
[ts] 'of' is declared but its value is never read.

// trivial example of what im trying to replace
  isLoggedIn(): Observable<boolean> {
    return Observable.of(true);
  }
Run Code Online (Sandbox Code Playgroud)

rxjs angular rxjs6

17
推荐指数
2
解决办法
1万
查看次数

gulp服务出错:需要外部模块babel-register

运行yeoman生成器"Webapp",运行gulp服务时出错.以下是更好背景的以下版本:

sw_vers && node -e 'console.log(process.platform, process.versions)'
ProductName:    Mac OS X
ProductVersion: 10.11.3
BuildVersion:   15D21
darwin { http_parser: '2.6.0',
  node: '5.2.0',
  v8: '4.6.85.31',
  uv: '1.7.5',
  zlib: '1.2.8',
  ares: '1.10.1-DEV',
  icu: '56.1',
  modules: '47',
  openssl: '1.0.2e' }

node -v
v5.2.0

gulp -v
Requiring external module babel-register
CLI version 3.9.1
Local version 3.9.1
Run Code Online (Sandbox Code Playgroud)

最后gulp服务错误:

gulp serve
Requiring external module babel-register
\node_modules/babel-core/lib/transformation/file/options/option-manager.js:372
      throw new Error("Couldn't find preset " + JSON.stringify(val) + "      relative to directory " + JSON.stringify(dirname));
Run Code Online (Sandbox Code Playgroud)

有没有人知道问题可能是什么,有什么建议吗?

这是我尝试过的:

npm uninstall gulp …
Run Code Online (Sandbox Code Playgroud)

yeoman gulp babeljs

12
推荐指数
1
解决办法
1万
查看次数

如何使用$ transition?

目前,我正在使用:

  • "angular-ui-router":"^ 0.4.2"
  • "棱角分明":"^ 1.6.3"
  • "webpack":"^ 2.4.1"

我知道我当前的实现可能已被弃用,只是寻找新方法的实现(示例或文档).非常感谢任何帮助,提前感谢!

目前的实施:

'use strict';

module.exports = angular
  .module('common', [
    'ui.router',
    'angular-loading-bar',
    require('./header').name,
    require('./sideBar').name,
    require('./footer').name
  ])
  .run(function($transitions, cfpLoadingBar) {
    $transitions.onStart({}, cfpLoadingBar.start);
    $transitions.onSuccess({}, cfpLoadingBar.complete);
  });
Run Code Online (Sandbox Code Playgroud)

当前错误:

未捕获错误:[$ injector:unpr]未知提供者:$ transitionsProvider < - $ transitions

javascript angularjs angular-ui-router webpack

12
推荐指数
1
解决办法
9378
查看次数

无法使用ngx translate/core - angular 2 typescript获得动态的文本翻译

问题:

我有来自Json文件的动态文本.我正在使用这样的translate.get()方法:

this.translate.get('keyInJson').subscribe(res => { 
                this.valueFromJson = res;
/*
creating an object using above text
*/
            });
Run Code Online (Sandbox Code Playgroud)

因为这是异步的,所以当页面呈现时我无法获得翻译的文本.我尝试在Observables,Promises中包装上面的方法但是在页面加载期间它无法获得翻译版本的文本.在尝试不同的方法之后,我能够获得翻译后的文本,但代码变得过于复杂且不可靠.

预期/期望的行为 应加载翻译版本的文本

复制问题 动态生成文本而不是在html上对其进行硬编码,然后尝试渲染翻译版本.

环境 Angular2,打字稿,离子2

javascript typescript ionic2 angular

10
推荐指数
2
解决办法
6182
查看次数

Webpack 2和Angular 1:导出和导入模块

希望得到一些澄清,为什么以下不能按预期工作,希望,这是我可能忽略的一些简单.没有Webpack,当前的实现可以按预期工作.

理想情况下,我希望保持当前的实现,我觉得注册组件/控制器/等应该在自己的文件中完成,只需指向相关模块.但如果这不是最佳做法,我也希望看到另一个建议.

文件root.module是我定义根模块的地方,然后在root.component文件中我将组件添加到该模块.

不导入模块的当前实现:

//root.component.js
'use strict';

var root = {
  template: require('./root.html')
};

module.exports = angular
  .module('root')
  .component('root', root);
'use strict';

//root.module.js
module.exports = angular
    .module('root', [
        require('./common').name,
        require('./components').name
    ]);
Run Code Online (Sandbox Code Playgroud)

如果我按预期执行以下工作并加载模块:

//root.component.js
'use strict';

var root = {
  template: require('./root.html')
};
module.exports = root;

//root.module.js
'use strict';

module.exports = angular
  .module('root', [
    require('./common').name,
    require('./components').name
  ])
  .component('root', require('./root.component'));
Run Code Online (Sandbox Code Playgroud)

当前目录树:

??? ./src
?   ??? ./src/app
?   ?   ??? ./src/app/app.less
?   ?   ??? ./src/app/app.spec.js
?   ?   ??? ./src/app/common
?   ?   ?   ??? …
Run Code Online (Sandbox Code Playgroud)

javascript angularjs angular-ui-router webpack

10
推荐指数
1
解决办法
1288
查看次数

List.JS - 无法读取未定义的属性'childNodes'

我似乎无法弄清楚这一点.我已经尝试过$(document).ready但仍然不适合我.我还尝试专门为这两个值名创建一个for循环,以将结果保存到var并以这种方式传递它.我也尝试将输入与class和id一起放在父div和outside之外.基本上就像在导航栏中一样.使用list.js和knockout.js btw.我使用foursquares api使用ajax请求获取我的场地.

JS:

        var options = {
        valueNames: ['name', 'category']
    };

    var userList = new List('search', options);
Run Code Online (Sandbox Code Playgroud)

HTML:

<body>
<nav>
    <h1 class="formattedH1">Downtown SA,TX</h1>
    <span>
      <input type="search" placeholder="Search" class="search" id="search">
      <input type="button" class="sort searchButton" value="List"></input>
    </span>
</nav>
<div id="map" class="map"></div>
<div class="list">
    <input type="search" placeholder="Search" class="search" id="search">
    <h1>My Top 5</h1>
    <!-- Square card -->
    <div class="card" id="favViewModel" data-bind="foreach: favList">
        <div class="expand">
            <h2 class="venueName" data-bind="text:name"></h2>
        </div>
        <div class="cardSupport" data-bind="attr: {src: image()}">
        </div>
        <div class="cardSupport" data-bind="text:address">
        </div>
        <a data-bind="attr: {href: website()}">Website</a>
    </div> …
Run Code Online (Sandbox Code Playgroud)

html javascript listjs

7
推荐指数
2
解决办法
4436
查看次数

如何使用Firebase隐形reCAPTCHA用于角度Web应用程序?

希望看到一个有效的例子.搜索了一下,似乎无法让它在本地工作.始终显示隐私条款徽标,用户必须与验证码进行互动.

这是我为加快速度而创建的一个codepen.

来自Firebase-Docs:

使用隐形reCAPTCHA

要使用不可见的reCAPTCHA,请创建一个RecaptchaVerifier对象,其size参数设置为不可见,指定提交登录表单的按钮的ID.

window.recaptchaVerifier = new firebase.auth.RecaptchaVerifier('sign-in-button', {
  'size': 'invisible',
  'callback': function(response) {
    // reCAPTCHA solved, allow signInWithPhoneNumber.
    onSignInSubmit();
  }
});
Run Code Online (Sandbox Code Playgroud)

基本上我在init的这个视图中有什么:

window.recaptchaVerifier = new firebase.auth.RecaptchaVerifier('phone-sign-in-recaptcha', {
  'size': 'invisible',
  'callback': function(response) {
    // reCAPTCHA solved - will proceed with submit function
    console.log(response);
  },
  'expired-callback': function() {
    // Reset reCAPTCHA?
  }
});
Run Code Online (Sandbox Code Playgroud)
<form name="mobile" novalidate>
  <label class="item item-input">
    <i class="icon placeholder-icon"></i>
    <input type="tel" name="number" ng-model="$ctrl.user.mobile">
  </label>
  <button id="sign-in-button" ng-click="$ctrl.onSignInSubmit(user.mobile)"></button>
</form>
<div id="phone-sign-in-recaptcha"></div>
Run Code Online (Sandbox Code Playgroud)

这是在提交时调用的函数:

ctrl.onSignInSubmit = …
Run Code Online (Sandbox Code Playgroud)

angularjs firebase firebase-authentication

6
推荐指数
1
解决办法
4510
查看次数

以编程方式单击子组件表单中的按钮

我正在尝试单击子组件内表单上的按钮。我也尝试过使用ViewChild& ViewChildren,将模板引用引用为ElementRef。它全部返回值而不是本机元素。Stackblitz-演示

import {
  Component,
  ViewChild,
  AfterViewInit,
  ElementRef
} from '@angular/core';
import {
  HelloComponent
} from './hello.component';

@Component({
  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent implements AfterViewInit {

  @ViewChild('test') form: ElementRef;
  name = 'Angular';

  ngAfterViewInit() {
    console.log(this.form);
  }
}



import {
  Component,
  Input
} from '@angular/core';

@Component({
  selector: 'hello',
  template: `
  Child Component
    <form class="login-as-user" [action]="formUrl" method="post" target="_blank">
      <input id="login-as-user" type="submit" value="reference this button">
    </form>
`,
  styles: [`h1 { font-family: Lato; …
Run Code Online (Sandbox Code Playgroud)

angular

4
推荐指数
1
解决办法
1万
查看次数

淘汰赛错误 - 无法处理绑定"foreach"

我在查看我的代码出了什么问题时遇到了一些麻烦.更有可能的是Knockout.js部分...它给了我以下错误:

消息:无法处理绑定"attr:function(){return {href:website()}}"

HTML

<div class="demo-card-square mdl-card mdl-shadow--2dp" data-bind="foreach: favoriteSpot">
  <div class="mdl-card__title mdl-card--expand">
    <h2 class="mdl-card__title-text">Update</h2>
  </div>
  <div class="mdl-card__supporting-text" data-bind="text:name"></div>
  <div class="mdl-card__supporting-text" data-bind="text:location"></div>
  <a data-bind="attr: {href: website()}">Website</a>
</div>
Run Code Online (Sandbox Code Playgroud)

JS

var favoriteSpotsList = [{
  venueName: "name",
  venueLocation: "address",
  website: "url",
  image: "<img src='img'",
}];


var favoriteSpot = function(data) {
  this.name = ko.observable(data.venueName);
  this.address = ko.observable(data.venueLocation);
  this.website = ko.observable(data.website);
  this.image = ko.observable(data.img);
};

var AppViewModel = function() {
  var self = this;

  /* Create array of hotspot locations. */
  this.hotSpotList = ko.observableArray([]);

  favoriteSpotsList.forEach(function(spot) …
Run Code Online (Sandbox Code Playgroud)

html javascript knockout.js

3
推荐指数
1
解决办法
2382
查看次数