标签: angular-foundation

我可以访问控制器中的表单吗?

我目前正在使用以下内容.

$scope.$$childHead.customerForm[firstName], 以便:

<form name="customerForm">
  <input type="text" name="firstName" 
         ng-model="data.customer.firstName" 
         tabindex="1"  
         ng-disabled="!data.editable" 
         validationcustomer />
</form>
Run Code Online (Sandbox Code Playgroud)

但这仅适用于Chrome.现在我尝试了以下内容:

$scope.editCustomerForm[firstName], 以便:

<form name="customerForm" ng-model="editCustomerForm">
  <input type="text" name="firstName" 
         ng-model="data.customer.firstName" tabindex="1"  
         ng-disabled="!data.editable" 
         validationcustomer />
</form>
Run Code Online (Sandbox Code Playgroud)

哪个不起作用.请注意,我的表单位于Foundation选项卡中.我怎样才能访问firstName

编辑:看起来它form没有被添加到scope基础选项卡中的时间.

任何人都有这个解决方案?

angularjs angular-foundation angularjs-forms

149
推荐指数
7
解决办法
17万
查看次数

UI-Router模式更改现有视图

我正在尝试使用ui-router来触发某个状态的模态,而不是改变整个视图.为此,我实现了常见问题解答中给出的略微适应的形式,因为我使用的是角度基础而不是引导程序.当我触发状态时,会显示模态,但是即使在我的状态中没有指定视图,它也会清除现有视图:

.state('selectModal',
  onEnter: ($modal, $state, $sessionStorage) ->
    $modal.open(
      templateUrl: 'views/select_modal.html'
      windowClass: 'tiny'
      controller: 'SelectCtrl'
      resolve:
        options: (Restangular) -> Restangular.all('options').getList()
    )
    .result.then (result) ->
      $sessionStorage.selected = result
      $state.go 'resource', id: result.id
)
Run Code Online (Sandbox Code Playgroud)

我应该为此状态配置视图/父级,例如<div ui-view='modal'></div>parent:'main'(我希望它可以从任何状态访问而不会在切换时改变该状态)?

angularjs angular-ui-router angular-foundation

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

Angularjs多指令在延迟加载时要求进行转换

我正在尝试使用ui.router,ocLazyLoad,Foundationangular-foundation设置一个简单的angularjs应用程序.

该应用程序是一个多视图应用程序,它的组件使用ocLazyLoad延迟加载.我没有问题设置视图和相关的控制器.但是,在尝试显示Foundation警报时出现问题.当我尝试查看警报(route1)时,我收到空警报.下面的堆栈跟踪.

为什么angular应用警报指令两次?这里有一个plunker:http://goo.gl/lhtD0c

Error: [$compile:multidir] Multiple directives [alert, alert] asking for transclusion on:        
<div class="alert-box" ng-class="(type || &quot;&quot;)" ng-repeat="alert in alerts" type="alert.type" close="closeAlert($index)">
http://errors.angularjs.org/1.2.22/$compile/multidir?p0=alert&p1=alert&p2=t…lerts%22%20type%3D%22alert.type%22%20close%3D%22closeAlert(%24index)%22%3E
at https://code.angularjs.org/1.2.22/angular.js:78:12
at assertNoDuplicate (https://code.angularjs.org/1.2.22/angular.js:6933:15)
at applyDirectivesToNode (https://code.angularjs.org/1.2.22/angular.js:6353:13)
at https://code.angularjs.org/1.2.22/angular.js:6858:37
at https://code.angularjs.org/1.2.22/angular.js:8091:11
at wrappedCallback (https://code.angularjs.org/1.2.22/angular.js:11546:81)
at wrappedCallback (https://code.angularjs.org/1.2.22/angular.js:11546:81)
at https://code.angularjs.org/1.2.22/angular.js:11632:26
at Scope.$eval (https://code.angularjs.org/1.2.22/angular.js:12658:28)
at Scope.$digest (https://code.angularjs.org/1.2.22/angular.js:12470:31)
Run Code Online (Sandbox Code Playgroud)

我索引的正文如下:

<body>
    <div>
        <a class="button" ui-sref="route1">Route 1</a>
        <a class="button" ui-sref="route2">Route 2</a>
    </div>

    <div ui-view></div>
</body>
Run Code Online (Sandbox Code Playgroud)

与此页面关联的javascript是:

var …
Run Code Online (Sandbox Code Playgroud)

javascript zurb-foundation angularjs angular-foundation

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