i have problem naming amd modules. best practice doing it?
for example iprofileservice.ts:
export interface iprofileservice { savepersonalinfo(): void; } in controller file:
import ps = module('../contracts/ipersonalinfoscope'); import pf = module('../contracts/iprofileservice'); export class personalinfoctrl { ... constructor( private $scope: ps.ipersonalinfoscope, private profileservice: pf.iprofileservice ) {...}; }; ... } so, problem need create each interface, class, etc. such sub name: ps, pf because have 1 class/interface per file. can this: contracts.ipersonalinfoscope, contracts.iprofileservice without puting them 1 file?
probably not since way merge these 2 types (ps , pf) variable. variable in variable declaration space , cannot used declare type. i.e. cannot:
var x = {a:123,b:123}; var y:x; // error more: http://basarat.github.io/typescriptdeepdive/#/declarationspaces
Comments
Post a Comment