按拼音首字母选择 {{x.sortName}}

{{c.cityName}} ` })

控制器:

.controller('cityListCtrl',['$scope','$http',function($scope,$http){
letthat=this;
//将城市名字存在本地
that.cityName=function(name){
console.log(123);
localStorage.setItem('cityName',name);
}
}])

使用组件:



路由设置:

.state('city_list',{
url:"/city_list",
templateUrl:'templates/indexTpl/city_list.html',
controllerAs:'cl',
controller:'cityListCtrl'
})

以上这篇angularjs1.5组件内用函数向外传值的实例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持毛票票。

热门推荐

免责声明:网站资源来源于网络,如有侵权,请及时联系删除。

Copyright © 2025 好资源导航网. All Rights Reserved.

蜀ICP备2021004611号-4 网站地图