angular-ui-switch

代码:https://codepen.io/anon/pen/gxmWzB

github: https://github.com/xpepermint/angular-ui-switch

功能类似于bootstrap的switch功能,由于数据绑定的存在,不使用对象中的方法切换,改用watch监听model绑定的值(示例中的enabled),

  状态切换触发的函数在监听器中实现

var viewTypeWatcher = $scope.$watch('enabled',function(newValue,oldValue,scope){
         if(newValue === true&&typeof newValue != 'undefined'){
             $scope.getPersonList(2,0);
         }else if(newValue === false&&typeof newValue != 'undefined'){
             $scope.personReach(2,0)
         }
     })

 

 

 

angular-ui-bootstrap demo地址:http://angular-ui.github.io/bootstrap/

转载于:https://www.cnblogs.com/insight0912/p/7306336.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Element-UI 是一个基于 Vue.js 的 UI 组件库,如果要在 Angular 中使用 Element-UI,需要先安装 Vue.js,并且在 Angular 中集成 Vue.js。 具体步骤如下: 1. 安装 Vue.js 在 Angular 项目中安装 Vue.js,可以使用 npm 命令进行安装: ``` npm install vue --save ``` 2. 安装 Element-UIAngular 项目中安装 Element-UI,同样可以使用 npm 命令进行安装: ``` npm install element-ui --save ``` 3. 集成 Vue.js 在 Angular 中集成 Vue.js,可以使用 ngx-build-plus 插件。在 Angular 项目中安装 ngx-build-plus: ``` npm install ngx-build-plus --save-dev ``` 然后在 angular.json 文件中配置 ngx-build-plus: ``` "architect": { "build": { "builder": "ngx-build-plus:browser", "options": { "extraWebpackConfig": "./extra-webpack.config.js" }, "configurations": { "production": { "extraWebpackConfig": "./extra-webpack.config.js" } } } } ``` 在 extra-webpack.config.js 文件中配置 Vue.js 的 loader: ``` const VueLoaderPlugin = require('vue-loader/lib/plugin') module.exports = { module: { rules: [ { test: /\.vue$/, loader: 'vue-loader' }, { test: /\.js$/, loader: 'babel-loader' } ] }, plugins: [ new VueLoaderPlugin() ] } ``` 4. 在 Angular 中使用 Element-UIAngular 中使用 Element-UI,需要先在组件中引入 Vue.js 和 Element-UI: ``` import Vue from 'vue' import ElementUI from 'element-ui' Vue.use(ElementUI) ``` 然后在组件中使用 Element-UI 的组件: ``` <template> <el-button>Button</el-button> </template> <script> export default { name: 'MyComponent' } </script> ``` 这样就可以在 Angular 中使用 Element-UI 了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值