小编Joe*_*aad的帖子

Angular2子路由不起作用

我正在使用@angular rc4 "@angular/router": "^3.0.0-beta.2"

我无法让子路由工作,当我开始添加子路由时,我会遇到很多种错误:这是我的路由代码:

{ path: '', redirectTo: 'parentComp'},
{ path: 'parentComp', component: parentContainer, 
        children: [
            {path: 'componenta', component: ComponentA }
        ]
    }
Run Code Online (Sandbox Code Playgroud)

EXCEPTION:在实例化路由器时出错!.BrowserDomAdapter.logError @ browser_adapter.js:84BrowserDomAdapter.logGroup @ browser_adapter.js:94ExceptionHandler.call @ exception_handler.js:65(匿名函数)@ application_ref.js:337schedulerFn @async.js:139SafeSubscriber .__ tryOrUnsub @ Subscriber.js:223SafeSubscriber.next @ Subscriber.js:172Subscriber._next @ Subscriber.js:125Subscriber.next @ Subscriber.js:89Subject.next @ Subject.js:55EventEmitter.emit @ async.js:127onError @ ng_zone .js:124onHandleError @ ng_zone_impl.js:74ZoneDelegate.handleError @ zone.js:327Zone.runTask @ zone.js:259ZoneTask.invoke @ zone.js:423 browser_adapter.js:84 ORIGINAL EXCEPTION:错误:路由的路由配置无效' {path:"",redirectTo:"activity"}':请提供'pathMatch'.'pathMatch'的默认值是'prefix',但通常意图使用'full'.BrowserDomAdapter.logError @ browser_adapter.js:84ExceptionHandler.call @ exception_handler.js:74(匿名函数)@ application_ref.js:337schedulerFn @ async.js:139SafeSubscriber .__ tryOrUnsub @ Subscriber.js:223SafeSubscriber.next @ Subscriber.js:172Subscriber._next @ Subscriber.js:125Subscriber.next @ Subscriber.js:89Subject.next @ …

typescript angular2-routing angular

13
推荐指数
1
解决办法
9226
查看次数

业力报道总是空洞的

我一直在试图运行业力报道几天,但现在只找到一个空的空白页面如下. 业力报道空报告

这是我的配置:

var path = require('path');

var webpackConfig = require('./webpack.common');

module.exports = function (config) {
  var _config = {
    basePath: '',
    frameworks: ['jasmine'],
    files: [
      { pattern: './karma-shim.js', watched: false }
    ],
    exclude: [],
    preprocessors: {
      './karma-shim.js': ['webpack', 'sourcemap', 'coverage']
    },
    client: {
      captureConsole: false
    },
    webpack: webpackConfig,

    webpackMiddleware: {
      stats: 'errors-only'
    },

    coverageReporter: {
      dir: 'coverage/',
      reporters: [{
        type: 'json',
        dir: 'coverage',
        subdir: 'json',
        file: 'coverage-final.json'
      }]
    },

    remapIstanbulReporter: {
      src: 'coverage/json/coverage-final.json',
      reports: {
        lcovonly: 'coverage/json/lcov.info',
        html: 'coverage/html',
        'text': …
Run Code Online (Sandbox Code Playgroud)

unit-testing typescript karma-runner karma-coverage angular

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

隐藏键盘触摸滚动视图

我开发了我的应用程序,之后,我发现我需要添加一个Scroll视图并在其中嵌入所有元素.在这样做之后,我注意到键盘外面的键盘没有消失.我知道因为IBAction绑定到ViewController而不是滚动器.滚动条不能有任何IBAction.有没有办法可以帮忙解决这个问题?在添加Scroll视图后,我已经搜索了很多并且丢失了隐藏键盘的信息.这一点不应该那么复杂.

谢谢!

keyboard background hide uiscrollview ios

6
推荐指数
3
解决办法
8724
查看次数

iOS - 访问 IBOutlet 的名称

我有几个 UIView 的 IBOutlet;我的父视图中的几个子视图。我试图循环所有 UIView 子视图。我想循环所有 IBOutlet 名称以“view_”开头的子视图

有人可以帮我解决这个问题吗?问题是我真的想访问 IBOutlet 的名称。

这是我的澄清代码:

@property (weak, nonatomic) IBOutlet UIView *view_player1;
@property (weak, nonatomic) IBOutlet UIView *view_player2;
@property (weak, nonatomic) IBOutlet UIView *view_referee1;

- (void)listSubviewsOfView:(UIView *)view {
    // Get the subviews of the view
    NSArray *subviews = [view subviews];

    // Return if there are no subviews
    if ([subviews count] == 0) return;

    for (UIView *subview in subviews) {
        NSLog(@"my subview name is: %@", subview.class);  //?? is only giving my the type eg UIView, …
Run Code Online (Sandbox Code Playgroud)

view classname subview iboutlet subviews

5
推荐指数
0
解决办法
235
查看次数

Silverstripe管理页面未来

我对silverstripe有点新手,让我的本地服务器上的一切工作都很完美,迁移远程服务器,乍看之下工作正常.第二天,我发现无法访问管理页面,虽然我刚刚访问它前一天.当我输入http://www.mydomain.com/admin时,我会使用以下网址访问我网站的主页

http://www.mydomain.com/Security/login?BackURL=%2Fadmin%2Fpages

我已经查看了所有在线帖子并且因为页面中没有错误或任何迹象表明可能在一夜之间出错而丢失了.

请指教!

谢谢,

php mysql mod-rewrite admin silverstripe

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

react-redux将道具传递给子组件道具

我试图将道具传递给子组件但是孩子总是收到空的.这是使代码更清晰的代码.

当我传递给子组件一个状态时,它工作 在这里是工作代码:

 render() {
   return (
     <div>
       <PostList list={ this.state.posts }></PostList> 
  </div>
  );
}
Run Code Online (Sandbox Code Playgroud)

但在我的情况下,我想从redux状态传递道具

不工作的代码:

render() {
    return (
      <div>
          <PostList list={ this.props.posts }></PostList>
      </div>
      );
  }
}
function mapStateToProps(state) {
  return {
    posts: state.posts.all,
    postDetail: state.posts.post
  }
}
Run Code Online (Sandbox Code Playgroud)

任何想法为什么PostList在第二种情况下获得一个空对象,即使this.props.posts在调用组件中实际上不是空的?

谢谢

javascript reactjs react-jsx redux react-redux

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